Using a dialog as the top most window ? 
Author Message
 Using a dialog as the top most window ?

Hi,
i am really new to perl-tk and require to pop up a dialog box  with a
notebook in it....
here is my code

use vars qw($top);

$top = MainWindow->new;

my $pb = $top->DialogBox(-title => "Profile",-buttons => ["OK", "Cancel"]);
my $n = $pb->add('NoteBook', -ipadx => 6, -ipady => 6);
my $PreferenceTab = $n->add("pref", -label => "Preferences", -underline =>
0);
$PreferenceTab->LabEntry(-label => "UNCName: ",-labelPack => [-side =>
"left", -anchor => "w"],-width => 20,-textvariable => \$uncname)->pack(-side
=> "top", -anchor => "nw");
$PreferenceTab->LabEntry(-label => "Sharename: ",-labelPack => [-side =>
"left", -anchor => "w"],-width => 50,-textvariable =>
\$sharename)->pack(-side => "top", -anchor => "nw");

$n->pack(-expand => "yes",
-fill => "both",
-padx => 5, -pady => 5,
-side => "top");

my $result ;
my $result = $pb->Show;

this pops up the desired dialog box but also another window , how do I get
rid of that window...

Thanx Chhil



Tue, 10 Jul 2001 03:00:00 GMT  
 Using a dialog as the top most window ?

[...]

Quote:

> this pops up the desired dialog box but also another window , how do I get
> rid of that window...

        $top->withdraw;

Regards,
        Slaven

--
use Tk;$c=tkinit->Canvas->pack;$x=45;for(split/_/,'KPI1_+09IPK_K;-OA1_+K!;A__1;
Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+KN._K+1Q!.F_1+KN.Q_+1Q__+1!
KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q'){s/\n//g;for(split/!/){$c->create(
'line',map{$a=-43+ord;($x+($a>>3)*2,123+($a&7)*2)}split//)}$x+=12}MainLoop



Tue, 10 Jul 2001 03:00:00 GMT  
 Using a dialog as the top most window ?
Hi,

I am still stuck.....

When i use the withdraw the perl interpretter is running even after I click
the OK button and the the 2 line for setting reg values do not get
activated.

thanx Chhil
if ($i==0)
{
my $uncname ;
my $sharename ;

use vars qw($top);
my $top = MainWindow->new;

my $pb = $top->DialogBox(-title => "Settings",-buttons => ["OK", "Cancel"]);
my $n = $pb->add('NoteBook', -ipadx => 6, -ipady => 6);
my $PreferenceTab = $n->add("pref", -label => "Preferences", -underline =>
0);
$PreferenceTab->LabEntry(-label => "UNCName: ",-labelPack => [-side =>
"left", -anchor => "w"],-width => 20,-textvariable => \$uncname)->pack(-side
=> "top", -anchor => "nw");
$PreferenceTab->LabEntry(-label => "Sharename: ",-labelPack => [-side =>
"left", -anchor => "w"],-width => 50,-textvariable =>
\$sharename)->pack(-side => "top", -anchor => "nw");

$n->pack(-expand => "yes",
-fill => "both",
-padx => 5, -pady => 5,
-side => "top");

my $result ;
$top->withdraw;
$result = $pb->Show;

MainLoop;
Win32API::Registry::RegSetValueEx($handle,$cszUNCNameKey,0,REG_SZ,$uncname,0
) or $i= 0;
Win32API::Registry::RegSetValueEx($handle,$cszShareNameKey,0,REG_SZ,$sharena
me,0) or $i= 0;

Quote:
}

print "jkjdgjdfjdkfgjdsgfjdsgfkjdssjdsjdskdfdskjf";

Quote:
}



Quote:

>[...]

>> this pops up the desired dialog box but also another window , how do I
get
>> rid of that window...

> $top->withdraw;

>Regards,
> Slaven

>--
>use

Tk;$c=tkinit->Canvas->pack;$x=45;for(split/_/,'KPI1_+09IPK_K;-OA1_+K!;A__1;

- Show quoted text -

Quote:
>Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+KN._K+1Q!.F_1+KN.Q_+1Q_
_+1!
>KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q'){s/\n//g;for(split/!/){$c->creat
e(
>'line',map{$a=-43+ord;($x+($a>>3)*2,123+($a&7)*2)}split//)}$x+=12}MainLoop



Tue, 10 Jul 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Dialog window and parent window

2. Dialog and only dialog; Dialog as subroutine

3. Tk Window problems keeping always on top

4. opening page in top window

5. Help on getting a Perl/Tk window to stay on top

6. how to bring a window at top

7. TK icon top left of window

8. How do I get a Tk window to stay on top

9. How do I get a Tk window to stay on top

10. top level window sizes ??

11. Resizing top-level window after packForget

12. Help: Listbox and full screen top level window

 

 
Powered by phpBB® Forum Software