Re: Trapping the Pharo window close event
Posted by
Peter Uhnak on
Apr 14, 2016; 6:27pm
URL: https://forum.world.st/Trapping-the-Pharo-window-close-event-tp4890079p4890080.html
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