Hi,
I am a newbie and trying to learn how to develop educational material using E-Toy. I went through several E-toy project, but still need some helps.
In the test program I was writing, I put a few text objects and a Button object from "Supplies" tab. My object was to change the text of one of the text objects when the Button is clicked.
First, I opened a Viewer for the Button object to figure out what kinds of things I can do to this Button object. I expected to find a method that will be invoked when the button object is clicked. To my surprise, there is no such method.
I was able to achieve the goal by (1) creating a script to change the text of one of the text objects and (2) creating "Button to fire to this script". But, I don't think this method is in sprite of Squeack, visual programming. I want to first create a button and make this button change the text of one of the text objects when this button is clicked, not the other way around. To me, this approach is in line of Squeak's philosophy.
Can any one please explain what I have missed?
Thanks in advance.
Young-Jin
Hello, Young-Jin,
I was able to achieve the goal by (1) creating a script to change the text of one of the text objects and (2) creating "Button to fire to this script". But, I don't think this method is in sprite of Squeack, visual programming. I want to first create a button and make this button change the text of one of the text objects when this button is clicked, not the other way around. To me, this approach is in line of Squeak's philosophy.
Can any one please explain what I have missed?
There are a quite a few different ways.
#1: * For the "Button" from the supplies bin, get the halo for it. * There is a pale green/blue handle near the bottom right corner. * You'll get the scriptor that is invoked when you click it. (You can programatically invoke the button's action by sending "fire" command in the "button" viewer category.
#2: * For any object, you can make it a button. * Create a scriptor for an Etoys object. * Hold the mouse button for a second on the "script status" that is showing "Normal" by default. You'll get a menu. * From the menu, choose "mouseDown" or "mouseUp". The script will be executed when you do click on (or click on and release) the object.
-- Yoshiki
squeakland@lists.squeakfoundation.org