[squeak-dev] singleton?

Joseph T. Bore jbore at tjtech.com
Thu Apr 10 03:41:27 UTC 2008


I would like to implement the following behavior, but im not sure how  
to accomplish it:

a method called plot, when its called, it would either create a new  
PlotMorph or if one is already on screen, re-use the existing plot  
morph.

I have the plot code working, but i cant figure out how to re-use the  
existing morph.

Im guessing a class side method that enforces a singleton via a class  
variable?  but when i destroy the morph, how do i have it clear out  
that variable so that subsequent calls will create a new one.

its very possible im coming at this entirely wrong, so feel free to  
make other suggestions for the implementation.

thanks in advance.

jb




More information about the Squeak-dev mailing list