Dr. Mu has asked for the wisdom of the Perl Monks concerning the following question:
So I'm wondering if, once the user clicks the little X, it's too late to intercept the destroy event before any actual destruction takes place. I've also tried the OnDestroy method in lieu of bind, but that gives me even less control -- well, no control actually -- over shutdown. I don't want to resort to a window with no decorations and a custom exit button, since the user won't be able to minimize it or move it around. Any ideas?
Update: To answer my own question:
intercepts the intent to exit before that intent is acted upon. That's what I was looking for. By the time bind or OnDestroy arrive at the scene, too much damage has already been done.$mw->protocol('WM_DELETE_WINDOW' => \&PowerDown);
|
|---|