Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Tk before destroy event

by strat (Canon)
on Jan 26, 2006 at 09:03 UTC ( [id://525679]=note: print w/replies, xml ) Need Help??


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"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://525679]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found