Oh wow! thanks - having the sample code will be a huge help. I'll give it a try.
-----Original Message----- From: Randal L. Schwartz [mailto:merlyn@stonehenge.com] Sent: Sunday, November 08, 2009 8:03 PM To: Christine Wolfe Cc: beginners@lists.squeakfoundation.org Subject: Re: [Newbies] OrderedCollection if imageMorphs
"Christine" == Christine Wolfe cwdw01@earthlink.net writes:
Christine> Oh, I'm so so sorry - I thought it was OK to ask dumb questions on Christine> the newbie forum (blush) I'll try to figure out how to make an Christine> instance variable an order collection.
It's perfectly OK, and that's why you were corrected. :)
Basically, you'll do the following:
* add an instance variable: contents
on your instance side, add:
initialize super initialize. contents := OrderedCollection new.
then for each item of the collection protocol, delegate it, as in:
add: anItem ^contents add: anItem.
includes: anItem ^contents includes: anItem.
size ^contents size.
and so on. If you get really tired of adding all of them, just add them as you need them (when the debugger tells you :).
If you wanna get really tricky, you can add a #doesNotUnderstand: handler to perform the method on the contents variable, but that can mess up your debugging, so it's better if you don't.