in reply to Tk before destroy event

Maybe the following piece of code might be interesting for you:

use Tk (); use Tk::Dialog (); my $mw = MainWindow->new(); $mw->protocol('WM_DELETE_WINDOW', \&ExitApplication); # ------------------------------------------------------------ sub ExitApplication { my $dialog = $mw->Dialog(-text => 'Programm wirklich beenden?', -bitmap => 'question', -title => 'Programm beenden', -default_button => 'Yes', -buttons => [qw/Yes No/], ); my $answer = $dialog->Show(); # and display dialog if (lc($answer) eq 'yes'){ # perhaps save data if necessary... exit; } else { # continue } # else } # ExitApplication

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"