David H. Shanabrook | 4 Jun 12:51 2007
Picon

Re: Mophic scripts tiles vs textual code

Thanks, this worked and helped.

So to extend this, and help my understanding, how do I refer to a  
morph in a workspace?  If I named the morph polyB, and I do something  
like "hide PolyB" in the workspace it asks about PolyB.

On 3 Jun 2007, at 14:26, Bert Freudenberg wrote:

> On Jun 3, 2007, at 19:50 , David H. Shanabrook wrote:
>
>> Hi.
>>
>> 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":
>>
>> 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".
>

Gmane