Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
World
Last updated at 2:04 pm UTC on 16 January 2006
The World in Morphic is the rectangular area which fills the whole screen.

Technically it is a global variable which keeps the instance of the topmost PasteUpMorph in the The Future of Squeak, 1999. All other morphs are submorphs (or submorphs of submorphs) of this Morph.

Any Morph answers the message 'world' with this topmost instance of PasteUpMorph.

So all Morphs you see on a screen belong to one big composition hierarchy with the global variable World pointing to the topmost Morph, which is a PasteUpMorph.

See 'The Design Patterns Smalltalk Companion' by Alpert, Brown, Woolf, p. 137: Composite pattern.

Note: Morph corresponds to 'Component' there. But Leaf and Composite are not factored out. So Morph has all the functions of Component, Leaf and Composite.

To get an array with the components of a Morph you send it the message 'submorphs'.

A red-click on the instance of PasteUpMorph kept in World brings up an instance of Dynamic open menu.

Also see How to apply some code to all submorphs of a Morph

28-Mar-2003/ hjh