[Newbies] OrderedCollection if imageMorphs
cwdw01 at earthlink.net
Sun Nov 8 13:28:00 UTC 2009
That worked!!! Thanks - I never would have figure it out on my own.
I'm so confused though. I've never had to explicitly call an initialize
method before - they seem to be invoked automatically when I use the word
"new". Should I always call the initialize when I create a new instance?
@Herbert - I'm making a pinball machine in which the little ball follows the
order of execution of a student entered flowchart.at least that's what I'm
trying to do ;-)
From: beginners-bounces at lists.squeakfoundation.org
[mailto:beginners-bounces at lists.squeakfoundation.org] On Behalf Of Alex
Sent: Sunday, November 08, 2009 3:59 AM
To: A friendly place to get answers to even the most basic questions about
Subject: Re: [Newbies] OrderedCollection if imageMorphs
I think you might need to call SymbolArray>>intialize by your self.
If you look at the chain of message sends starting from 'SymbolArray new'
1) OrderedCollection new
2) OrderedCollection new:
3) Behavior basicNew
There is no call to initialize.
On Sat, Nov 7, 2009 at 16:28, Christine Wolfe <cwdw01 at earthlink.net> wrote:
I want to put add an imageMorph on top of another imageMorph.
I can do this with the following method (note SymbolBlank is an imageMorph
im := SymbolBlank new.
self addMorph: im.
im topLeft: 2 at 2.
I want to enhance this so I can choose one of a collection of imageMorphs to
I created a class, SymbolArray, that is a subclass of OrderedCollection with
the following initialize method. Each of the items I'm adding (SymbolBlank,
SymbolGet, etc) is an imageMorph.
self add: SymbolBlank new.
self add: SymbolGet new.
self add: SymbolProcess new.
self add: SymbolPut new.
self add: SymbolIf new.
self add: SymbolWhile new.
Then I tried to modify the addSymbol method as show below.
When I do, I get the following error message which sounds like I don't have
an element at index 1.
| sa si |
sa := SymbolArray new.
si := sa at: 1.
self addMorph: si.
si topLeft: 2 at 2.
I hope someone can help me figure out how to accomplish what I want to do.
Beginners mailing list
Beginners at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners