Bootstrapping a squeak application.
Ned Konz
ned at bike-nomad.com
Tue Apr 17 21:20:18 UTC 2001
On Tuesday 17 April 2001 11:21, Thaddeus L. Olczyk wrote:
> I'm not clear on how to start a squeak application.
> In particular:
> I would like to for someone to start the image,
> have the application read configuration details from enviromental
> variables, the command line, configuration files etc.
>
> Here is what I am unclear on:
> "where is the method"/" how do I specify the method"
> that gets called when the vm first loads an image.
A couple ways to do this:
* you can pass a script name (a .st file) in as a command line argument. This
will be read and executed (if allowed)
* any classes registered in Smalltalk's StartUpList will have #startUp:
called with a "resuming" argument that says whether this is a real startup or
just a resume after a snapshot. Likewise for the ShutdownList and #shutDown:
quitting (the flag is true if we're really quitting).
addToStartUpList: aClass after: predecessor
addToShutDownList: aClass after: predecessor
if predecessor is nil, aClass is added to the end of the list.
So somewhere you'd go:
Smalltalk addToStartUpList: MyClass after: nil.
and of course provide a MyClass class>>startUp: method.
> Also ( slipping it in because I don't thnk it is worthy a topic of
> it's own ).
> How do I save a squeak image?
> TO me this isn't very clear.
Smalltalk snapshot: true andQuit: quitFlag
if quitFlag is true, you quit too.
--
Ned Konz
currently: Stanwood, WA
email: ned at bike-nomad.com
homepage: http://bike-nomad.com
More information about the Squeak-dev
mailing list
|