fanticla has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
What I am doing wrong in this script? If I clic on the X button, the window won't close...
use warnings; use strict; use Tk; use Tk::Dialog; my $mw = MainWindow->new(); my $dialog_setup = $mw->Dialog(-title => "My Window", -background=>"wh +ite",-buttons => [qw/Ok Quit/]); my $frame0 = $dialog_setup->Frame (); $frame0->pack(-side => 'top', -expand => 'both', -fill => 'x'); $frame0->Label(-background=> 'white', -text => "This is my window", -b +ackground=>"white")->pack(-side => "left", -anchor => "w",-fill => "b +oth",-expand => "x"); my $answer = $dialog_setup->Show(); if ($answer=~ /Ok/){ do_something();} MainLoop();
Thank you for your advice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: tk close window
by kcott (Archbishop) on Nov 07, 2010 at 10:58 UTC | |
by fanticla (Scribe) on Nov 07, 2010 at 11:01 UTC | |
by kcott (Archbishop) on Nov 07, 2010 at 16:11 UTC | |
|
Re: tk close window
by Khen1950fx (Canon) on Nov 07, 2010 at 14:47 UTC | |
|
Re: tk close window
by PeterPeiGuo (Hermit) on Nov 07, 2010 at 17:08 UTC | |
by fanticla (Scribe) on Nov 07, 2010 at 21:20 UTC | |
|
Re: tk close window
by Anonymous Monk on Nov 07, 2010 at 11:51 UTC |