Hi Steven --
What you are trying to do is not Etoys, but to do something in Squeak Smalltalk using one of its graphics systems (called Morphic). Etoys is a UI that rides on top of Squeak Smalltalk. Its objects are called "Players" and the associated graphics of a player is called its "costume". Using Squeak Smalltalk, you can talk to the costume of a player by saying "self costume blah blah", where blah blah is a message that morphs understand.
There are lots of manuals for Smalltalk, and Squeak Smalltalk, and even one for Etoys.
Cheers,
Alan
At 10:01 AM 1/23/2007, Steven Greenberg wrote:
Hi. I would like to use EToys for a project but I'm having a hard time adding my own actions. I suspect that I am missing something obvious, and would appreciate any pointers you could offer. I've tried to RTFM, but I can't find the FM so I'm kind of stuck.
So... As a test case, I decided that I would make some simple methods to animate the opacity of a Morph. I also wanted to add an instance variable and manipulate it.
So I created a subclass of Morph and, on the class side, added:
additionsToViewerCategories
^ #( (#seg ( (slot grink 'grink is a nonsense variable'
String readWrite Player getGrink Player setGrink:) (command changeOpacityLevel: 'change the opacity level' Player) )))
and I created #getGrink, #setGrink:, and #changeOpacityLevel: on the new subclass of Morph.
When I instantiate the new object and open an etoys viewer, the "seg" category is there but it is empty.
I'm running the latest Squeak 3.9 image on a Mac, downloaded form http://squeak.orgsqueak.org.
Suggestions?
Regards, Steve
Etoys mailing list Etoys@laptop.org http://mailman.laptop.org/mailman/listinfo/etoys
On 1/23/07, Alan Kay alan.kay@squeakland.org wrote:
Hi Steven --
What you are trying to do is not Etoys, but to do something in Squeak Smalltalk using one of its graphics systems (called Morphic). Etoys is a UI that rides on top of Squeak Smalltalk. Its objects are called "Players" and the associated graphics of a player is called its "costume". Using Squeak Smalltalk, you can talk to the costume of a player by saying "self costume blah blah", where blah blah is a message that morphs understand.
Hi Alan, thanks for the answer. I think I actually do want EToys because I want my objects to be generically scriptable using tiles. That example I asked about was chosen because it's something I already know how to do in squeak :-). It's not the actual project, just a learning exercise.
Regards, Steve
etoys-dev@lists.squeakfoundation.org