Re: Trapping the Pharo window close event
Posted by
stepharo on
Apr 15, 2016; 8:06pm
URL: https://forum.world.st/Trapping-the-Pharo-window-close-event-tp4890079p4890258.html
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?
Stef
Le 14/4/16 20:58, Peter Uhnák a écrit :
The closing is intercepted in
PasteUpMorph>>windowEvent:
from where this is called
WorldState>>quitSession
| save |
save :=
self confirm: 'Save changes before quitting?' translated
orCancel: [ ^ self ].
save
ifTrue:
[Smalltalk snapshot: true andQuit: true]
ifFalse:
[Smalltalk snapshot: false andQuit: true]
So you can change the method for example to
WorldState>>quitSession
Smalltalk
snapshot: true andQuit: true
(or snapshot: false if you don't want to save)
Or you can close it by clicking on world menu and selecting
"Save and quit".
Peter