[question]submorphs accessing

Bob Arning arning at charm.net
Wed May 10 16:06:22 UTC 2000


On Wed, 10 May 2000 17:37:50 +0200 Karl Ramberg <karl.ramberg at chello.se> wrote:
>I made a simple RectangleMorph containing a LedMorph. Now I want to
>send a value to that submorph, but I can't find a way of doing that.

Well, you could do something like:

r _ RectangleMorph new.
r addMorph: LedMorph new.
r firstSubmorph color: Color red.

but it would probably be cleaner to remember the LedMorph (save it in a variable when you create it) rather than later assume you know where it is in some other morph's collection of submorphs.

Cheers,
Bob





More information about the Squeak-dev mailing list