Code Comments
Programming Forum and web based access to our favorite programming groups.I want to create a new window that will not die when the parent (the main program) dies (exits, is destroyed, etc. I can't find this in the docs or examples - or a search on this group. Is this possible?
Post Follow-up to this messageOn 19 Nov 2004 22:53:43 -0800, bayxarea-usenet@yahoo.com wrote:
>I want to create a new window that will not die when the parent (the
>main program) dies (exits, is destroyed, etc. I can't find this in the
>docs or examples - or a search on this group.
>
>Is this possible?
You can create 2 mainwindows.
#!/usr/bin/perl -w
use Tk;
my $mw = MainWindow->new(-title=>"#1");
$mw->Button(-text=>"Make NEW Window",
-command=> sub { make_win(); })->pack;
$mw->Button(-text=>"Close Me",
-command=> sub { $mw->destroy })->pack;
MainLoop;
sub make_win
{
my $mw1 = MainWindow->new(-title=>"#2");
$mw1->Button(-text=>"CLOSE this window",
-command=> sub { close_win($mw1); }
)->pack();
}
sub close_win
{
my $thiswin = $_[0];
$thiswin->destroy;
}
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Post Follow-up to this messageIn article <1100933623.952701.260670@z14g2000cwz.googlegroups.com>, bayxarea - usenet@yahoo.com says... > I want to create a new window that will not die when the parent (the > main program) dies (exits, is destroyed, etc. I can't find this in the > docs or examples - or a search on this group. > > Is this possible? No. -- Go to http://MarcDashevsky.com to send me e-mail.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.