squeak exit handler

Stephane Ducasse ducasse at iam.unibe.ch
Tue Sep 2 19:25:41 UTC 2003


Alain

if you want to have some code executed when you load a file you can
	- use the postscript in the changeset (changeset sorter) Experiment a 
bit I got confused the last 	time to know if you should add " or ' or 
not around the expression.
	- you can also add the expression at the end of the file terminated by 
!! (check with the class fileout). This is that way that classes get 
initialize. If you write a class method initialize and file it out, 
then the late expression of the files will be MyClass initialize.

Stef

PS: Once we should meet when I will come at Lyon to see my friends 
there (excellent food :))

On Tuesday, September 2, 2003, at 08:50 PM, ALR wrote:

> Hi,
>
> Here is the code for having squeak code to handle the windows close 
> message.
> Actually the only message handled is windows close, but it could be
> interesting to have other system notifications like iconify, sleep etc.
>
> The modifications are of 2 types :
> 1) modifications to the vm source (windows version 3.4.3, should be 
> easy to
> add to unix vm), the modifications are tagged between lines //ALR> and
> //<ALR (to be removed) to make them more visible.
> 2) The second part is the changeset that add the exit handler classes 
> to the
> squeak run-time.
> I also added a new option to the system menu that exit like before, to 
> give
> the user a possibility to exit when squeak is hung.
> After having filed in the change set, in a workspace, you have to do a
> 'EventSensor initialize' to define some additional constants used by 
> the
> code - this is mandatory.
>
> The window close message follows the standard event handling (queuing 
> by vm,
> io process, dequeuing and handling by HandMorph), and the squeak 
> handler
> code is run in the UI process, like in any other windows applications. 
> The
> application can then decide if it is safe to exit.
> Actually the handler only ask exit with save : yes/no/cancel.
>
> This changeset works fine with a 3.4 but DOES NOT WORK in 3.6 image 
> because
> of changes in EventSensorConstants.
>
> regards,
>
> Alain
>
>
>
> <exit-handler-vm.zip>
> <SystemEvents.2.cs>



More information about the Squeak-dev mailing list