submorphs
Last updated at 6:49 pm UTC on 9 September 2019
A Morph may contain other morphs. They are in a collection called 'submorphs' ("child nodes").
m := Morph new openInWorld.
m submorphs
The result of print-it is
#()
i.e. no submorph.
The method
#addMorph: aMorph
is used to add a submorph.
You may use
m submorphs select: [:aSubmorph | "a test performed on the submorph"]
to get a collection of morphs you are interested in.
Example - aMorph addMorph: anotherMorph (no layout and TableLayout)
See also
aMorph submorphsDo: aBlock_
tagBeginner