self
self copied to clipboard
Morphs don't have names
One change that post-Self morphic (Squeak/Pharo/Cuis) has from the original is that morphs have a 'properties' slot which is a dictionary for holding information about the morph.
I am wary about this as being too loose. I suspect it is a reaction to Smalltalk objects being harder to customise than Self ones.
However one useful aspect may be that morphs can be given 'names', which allows for owners to send messages directly to submorphs buried in the nested submorph tree.
At the moment, Self morphic handles this need either by stashing a copy of the target morph in a slot at the owner level or by finding the morph by position (eg morphs first morphs at: 3
. Both of these are brittle and easy to break.
It may be useful to add a name
slot to morphs to solve this.
But if going down that path, why have a canonical name
? Maybe we should be able to tag morphs with multiple tags...
addTag: t
removeTag: t
isTagged: t
morphsTagged: t Do: blk
(label
would be nicer but is used for gui stuff like labelling buttons.)
This covers a greater variety of message patterns.