Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005201 [Squeak] Morphic major N/A 10-08-06 21:29 10-09-06 02:33
Reporter rhawley View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.9
Summary 0005201: Appropriate relay of messages from the morph to its costume (+ derivative improvements)
Description Currently the following does not work (when reasonably it should):
   EllipseMorph new openInWorld; lowerPen; turn: 135; forward: 500
The first fix given in the attached changes file fixes this by relaying messages to the morph's player.

This is a major fix that will make it much easier to drive morphs using direct Smalltalk code - a bonus for the initial teaching of Smalltalk. (It makes coding consistent with using the EToys scripting tiles).

The second fix in the attached file allows morphs to be accessed using their names. E.g. :
  (World morphNamed: #Star) forward: 99
This is useful for the "Press Me" button - this fix is used to allow the name to be specified in the Target field of a button.
Additional Information 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

Testing: An example Morph that makes very good use of the relaying works well. The main effect is to ensure that the morph's player exists, so the scripting system is not effected by this change.

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.)

Testing: This has worked with several examples. The fix tests for flaps so that it can ignore them - because flaps of the same name as a morph are created. If there is more than one morph of the same name, it is essentially arbitary as to which gets chosen. There may be possible future improvements, but the fix works as intended so far.
Attached Files

- Relationships

- Notes
(0007629 - 46 - 46 - 46 - 46 - 46 - 46)
10-08-06 21:42

Sorry - finger trouble - submitted this twice.
(0007631 - 72 - 72 - 72 - 207 - 207 - 207)
10-09-06 02:33

see 0005202 for the main thread of this. this is the incomplete duplicate.
(0007632 - 72 - 72 - 72 - 207 - 207 - 207)
10-09-06 02:33

see 0005202 for the main thread of this. this is the incomplete duplicate.

- Issue History
Date Modified Username Field Change
10-08-06 21:29 rhawley New Issue
10-08-06 21:36 rhawley Issue Monitored: rhawley
10-08-06 21:42 rhawley Note Added: 0007629
10-09-06 02:33 wiz Note Added: 0007631
10-09-06 02:33 wiz Note Added: 0007632

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
43 total queries executed.
32 unique queries executed.
Powered by Mantis Bugtracker