Interface class in Squeak
Hoang Hao
hoanghao456 at yahoo.com
Wed Jun 8 05:11:19 UTC 2005
Thanks everyone for your reply. I tried the SharedPool idea, but a message do not understand warning, and I don't know where this error comes from. Here are what I did:
1. I made a SharedPool subclass named GUIConstants that has a class variable, totalAnimatedFrame.
2. I initialized it to be 5 in the initialization.
initialize
"to initialize constants"
super initialize.
totalAnimatedFrame _ 5.
3. I created another class named testGUI that uses the value of totalAnimatedFrame.
initialize
"to initialize"
super initialize.
variable _ GUIConstants totalAnimatedFrame.
In the workspace, I executed:
c _ GUIConstants.
t _ TestGUI new.
All of these works grant me a warning, Message not understood: GUIConstants >> totalAnimatedFrames.
I traced through the error and found it located in the initilization of the testGUI.
If anyone knows, please let me know how I can fix the problem.
Thanks,
Hoang Hao
Tim Rowledge <tim at rowledge.org> wrote:
Todd Blanchard wrote:
> What do you want the interface for?
>
> If it is just to provide a place to declare some useful constants and
> share them with a few classes, then you may want a PoolDictionary
That would be a SharedPool subclass these days. Still a tricky little bugger
but a bit less awful than randomly assembled dictionaries. At least they assist
in providing a declarative (re)initializer.
tim
--
Tim Rowledge, tim at rowledge.org, http://www.rowledge.org/tim
Useful random insult:- A 20th century man... The guy has no future.
---------------------------------
Discover Yahoo!
Stay in touch with email, IM, photo sharing & more. Check it out!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050607/016417b1/attachment.htm
More information about the Squeak-dev
mailing list
|