Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
MorphExtension
Last updated at 9:10 pm UTC on 30 August 2016
Every graphical object (including strings) you see on the screen within a Morphic Project is a Morph. Morphs may be "light" or "heavy".

To save space Morph objects has only a few instance variables


For simple morphs the value of the 'extension' variable is not set.


Light_Morph_which_has_extension_nil_2016-08-30.png


In Pharo
Light_Morph_which_has_extension_nil_Pharo5.0_2016-08-30.png

For more complex morphs an instance of the MorphExtension class is attached to the Morph instance. It keeps the additional instance variables the Morph needs. This is done with lazy initialisation.

To even add more flexibility the MorphExtension instance includes an instance variable called 'otherProperties'.
It holds an IdentityDictionary where additional data may be kept.

You may use 'otherProperties' to add your own data to a morph.

You do not have to deal with MorphExtension directly. You just use messages of the type


you simply send to the aMorph.

Note: properties have to be in the form of aSymbol, not aString.)