[Newbies] Mophic scripts tiles vs textual code
bert at freudenbergs.de
Sun Jun 3 18:26:07 UTC 2007
On Jun 3, 2007, at 19:50 , David H. Shanabrook wrote:
> I am writing some simple morphic scripts. It would be convenient
> to use smalltalk directly, so I toggle the script to directly enter
> the code. But I am having problems, as it is not working. If I
> uses tiles to create a script and then toggle over to text mode,
> the script looks like this for script "showa":
> self setX: PolyZb getX.
> self setY: PolyZb getY.
> self setHeading: PolyZb getHeading.
> PolyZb hide.
> self show
> I think when I type the script in directly it doesn't know how to
> reference PolyZb (a polygon object I created).
You need to reference an object at least once in another object's
tile script to make it "known" to the scripting system (*). After
that, you can just type the name.
> Any help? How does this translation between morph object's name
> and the internal SmallTalk name happen?
It's "Smalltalk", btw., with a lower-case "t".
- Bert -
(*) More precisely, #uniqueNameForReference must have been sent to
the object to put it into the global registry named "References".
More information about the Beginners