
It's usual to call the "Squeak desktop": WORLD.
At this "world" we will put many objects. At the previous lesson we have created an object of the type: Text.
An object can have a visual appearance (like our last) or can't have. An example of object that doesn't have an appearance is one of the type Dictionary. We will use one of then soon.
We know how to create a visual object. We need to drag the icon of its type from the Supplies palette. In the Supplies we can also drag an "Object Catalog" having many other visual objects we can use. We have, by example an object who is a Text having a border:
Is interesting sometimes to change the name of the object. We do it opening the Viewer of the object and typing over the old name.
At this lesson we will create another very simple program/script. We will create 2 objects of the type Text-having-border and we would like that: when we type something in one (called In1) the string is transported for the other (called Out1).
Is usual to open the script for the output object (here Out1). Do it draging the arrow of the line "Out1 characters <- abc" like we did at previous lesson.
Now we will learn a spectacular resource of Squeak: we can do part of the program visually!
Open the Viewer of In1 and drag only the part "In1 characters" of the line having: "In1 characters <- abc" over the part abc in the script window. Look the figure:
Opening the window of code (like in the previous lesson) we will see the code:
self setCharacters: In1 getCharacters.
To create the ilusion of transport we would like that the input area is cleared; so, we complete the script to be:
self setCharacters: In1 getCharacters. In1 setCharacters: ''.
And we do the "accept" like in the previous lesson.
We can run the script clicking the "yellow exclamation" but we will like now to do something better. Clicking over the name Out1 we open a window and select: "button to fire this script":
Clicking in the Menu of the "halo" of the button we can change its label.
We can move it using another button of the halo, to have the final project.
To erase the default texts of the Texts (abc) for the "initial situation" of the project we can (like usual) drag the pointer over the letters and press the tab key of the keyboard.
Play with our project! :
PREVIOUS LESSON NEXT LESSON T. CONTENTS HOMEPAGE
