Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Tk - intercepting alt-f4 and the likeby strat (Canon) |
on Mar 18, 2002 at 12:18 UTC ( [id://152463]=perlquestion: print w/replies, xml ) | Need Help?? |
strat has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks, I'm playing around a little bit again with Tk, and got the following problem: If anybody just presses at the X at the upper right corner of the window or Alt+F4 (i mostly work under Win2k), the Window closes and the program finishes.
With something like the code above, I could at least do some cleanup before quitting. What I'm looking for: if somebody presses the X at the top right corner of the window or Alt-F4, I want a MsgBox to pop up and ask "Do you really want to quit (Yes/No)", and if the user presses the Button for "No", the program should continue running. With OnDestroy, I only know a way to quit, but not to go on.
Best regards and thanx in advance,
Back to
Seekers of Perl Wisdom
|
|