Login  Register

Re: Trapping the Pharo window close event

Posted by Esteban A. Maringolo on Apr 15, 2016; 9:12pm
URL: https://forum.world.st/Trapping-the-Pharo-window-close-event-tp4890079p4890265.html

Maybe he refers to the option to abort the close request programmatically in an event based approach.

Something like that UI close event is handled and triggers a "QuitSmalltalkRequested" event (or announcement) with a boolean value holder as argument, if no one handling such event/announcement vetoed the request, then it continues to normal shutdown.

Dolphin Smalltalk uses that approach, see SessionManager >> queryEndSession at [1]

Regards,

Esteban A. Maringolo

2016-04-15 18:06 GMT-03:00 Peter Uhnák <[hidden email]>:
I did not really get it. Now I have the impression that changing the method definition shows that Pharo does not
offer the correct possibility.
Am I correct?

I disagree. Closing the window should not decide on it's own whether the session should be saved. Asking the user is the right thing.

The ideal thing would be to not ask if nothing has happened... but that's impossible, this is a live system, not a text editor.

Peter