Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
How to apply some code to all submorphs of a Morph
Last updated at 10:20 am UTC on 6 May 2019
Morphs form a composition hierarchy. You can access the submorphs of a Morph by sending it the message #submorphs.

With
 aMorph submorphsDo: [:each | each someMessage]

you can send someMessage to all direct submorphs.

However if you want to apply something to the whole composition hierarchy you have to use

 aMorph allMorphsDo: [:each | each someMessage]

tagBeginner