in reply to Re: tk close window
in thread tk close window
I'm running the script on XP and Perl 5.8.8
I found the following work around (using protocol('WM_DELETE_WINDOW'):
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/]); $dialog_setup->protocol('WM_DELETE_WINDOW', \&destroy_dialog); my $answer = $dialog_setup->Show(); if ($answer=~ /Ok/){ do_something();} MainLoop(); sub destroy_dialog { $dialog_setup ->destroy; }
|
|---|