[squeak-dev] Execute on Launch?

David T. Lewis lewis at mail.msen.com
Sun Sep 7 15:36:25 UTC 2008


On Sun, Sep 07, 2008 at 05:13:05PM +0200, Bert Freudenberg wrote:
> 
> Am 07.09.2008 um 17:09 schrieb David T. Lewis:
> 
> >On Sun, Sep 07, 2008 at 10:41:59AM -0400, Jim Rosenberg wrote:
> >>How do I get a method in one of my own classes to fire when Squeak  
> >>first
> >>launches?
> >
> >Step one:
> >On the class side of your class, implement #startup: and have
> >your #startup: method do whatever needs to be done on image startup.
> >The parameter to the #startup: method will indicate whether the
> >image is being restarted (versus resuming after an image save), so
> >test for this (resuming ifTrue: [do my startup stuff]).
> >
> >Step two:
> >In a #initialize class method for your class, add the line:
> >	Smalltalk addToStartUpList: self.
> >Evaluate this one time to add your class to the system startup
> >list. This causes your #startup: method to be called whenever
> >the image is restarted.
> >
> >Step three:
> >Save your image, restart, and see if it works.
> >
> >Dave
> 
> #startUp: works better ;)

Oops! Well, I guess that must be the reason for step 3 ;)

Dave




More information about the Squeak-dev mailing list