[ENH] MorphMessageFix

rhawley at plymouth.ac.uk rhawley at plymouth.ac.uk
Thu Oct 5 02:46:47 UTC 2006


from preamble:

"Change Set:		MorphMessageFix
Date:			5 October 2006
Author:			rhawley

First Matter
---------__--

Morphic scripts can send messages like forward: to Morphs, but
currently, if this is done as Smalltalk code it does not always work
because the morph needs to relay the command to its costume, but if the
costume does not yet exist it will need to be explicitely created.  The
separation of 'player' and 'costume' means that a morph cannot currently
directly respond to player messages; as the trick of trapping the
doesNotUnderstand: is already being used for morphic's tile based
scripts, it seems reasonable to use the same type of technique so that
we can write code that properly treats morphs as first class objects (as
they were intended to be).

So, with this fix we can straight forwardly do things like:

X := EllipseMorph new.
X openInWorld.
X lowerPen; turn: 135; forward: 500

Second Matter
----------------

The naming of Morphs is currently not fully developed or very convenient
to use.  The fix to the SimpleButtonMorph makes it possible to reference
a morph by using: 
(World morphNamed: #Jim) forward: 99
assuming that you have bought up the halos and edited a morph's name to
be Jim. (This also makes use of the first fix to relay the forward:
message.)

 "
!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MorphMessageFix.cs.gz
Type: application/octet-stream
Size: 1718 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20061005/c537824e/MorphMessageFix.cs.obj


More information about the Squeak-dev mailing list