Anonymous | Login | 03-02-2021 02:32 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | |||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
0005202 | [Squeak] Morphic | major | N/A | 10-08-06 21:30 | 10-10-06 05:42 | |||||||
Reporter | rhawley | View Status | public | |||||||||
Assigned To | ||||||||||||
Priority | normal | Resolution | open | |||||||||
Status | new | Product Version | 3.9 | |||||||||
Summary | 0005202: 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 |
![]() |
|||||||||||
|
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
42 total queries executed. 31 unique queries executed. |