[Newbies] How can I create a scripting tile in Etoys/Squeak
K. K. Subramaniam
kksubbu.ml at gmail.com
Tue Feb 15 03:41:51 UTC 2011
On Monday 14 Feb 2011 4:49:33 pm Steve Thomas wrote:
> In the class additionsToViewerCategoryFraction I added a "slot" using:
>
> (slot st1 'The quantity of Steve parts' Number readWrite Player
> getMajorTicks Player setMajorTicks:)
>
>
> The part I was missing was I had to to Etoys-Scripting Player the
> getMajorTicks and
> setMajorTicks Methods.
>
> I also found I can use command instead of slot.
slot refers to property values and you need getter methods (for ReadOnly) and
getter/setter for ReadWrite property. command refers to actions. In your
methods, you can access the morph involved in the player using:
self costume renderedMorph
The tricky part is that you have to choose unique names for slots, commands,
getters and setters. This is because Player uses a flat name space for all
slot/command names and methods. This may look simple, but you could have
packages loaded from outside that could introduce name clashes.
BTW, I mistook you for another Steve in my earlier reply. Sorry.
Subbu
More information about the Beginners
mailing list