Hi all,
I am fairly new to Squeak, and so far I have figured out the syntax and everything, I do understand the basics. However, I am stuck on one particular thing - manipulation of objects that have been created, and are now in a World. I think the easiest example of what I mean is by the following. Assume for a moment I have created a simple RectangleMorph in the World, in this case with a specific parameter, the color. The code for this would work out as: | rectangle | rectangle := RectangleMorph new openInWorld. rectangle color: Color white. Now, that the object is created in the World, how do I change its properties while it exists? How would one change the color of the RectangleMorph in this example, while it is on screen? Since everything is an object, and objects can receive messages, I do believe this to be possible, correct? Thanks for your help, Marcus _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Hi > | rectangle | > rectangle := RectangleMorph new openInWorld. > rectangle color: Color white. > > Now, that the object is created in the World, how do I change its > properties while it exists? How would one change the color of the > RectangleMorph in this example, while it is on screen? Since > everything is an object, and objects can receive messages, I do > believe this to be possible, correct? Just send messages to your reference (rectangle). You did this in line 2 rectangle color: Color white. You can send other messages like rectangle useRoundedCorners. If you dont have a reference to your morph, open a workspace, select in its menu "create textual references to dropped morphs" then drag and drop your morph into your workspace. Use the printed reference to send messages to. Hope this helps Enno -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHgUKpRar8+mLBvIcRAiEzAJ0SapyszXWsgQGKJB73igEQHHfrmQCfR2pG 4rb15n30jFTDOAj+BkMLQfM= =UynF -----END PGP SIGNATURE----- _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
On Jan 6, 2008, at 22:05 , Enno Schwass wrote:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi > >> | rectangle | >> rectangle := RectangleMorph new openInWorld. >> rectangle color: Color white. >> >> Now, that the object is created in the World, how do I change its >> properties while it exists? How would one change the color of the >> RectangleMorph in this example, while it is on screen? Since >> everything is an object, and objects can receive messages, I do >> believe this to be possible, correct? > > Just send messages to your reference (rectangle). > > You did this in line 2 > > rectangle color: Color white. > > You can send other messages like > > rectangle useRoundedCorners. > > If you dont have a reference to your morph, open a workspace, > select in its menu > > "create textual references to dropped morphs" > > then drag and drop your morph into your workspace. Use the printed > reference to send messages to. Actually, the usual way is to open an inspector on the object you want to work with, and start sending messages to self. - Bert - _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
ya, an inspector works, you can also use the halo to change some things in morphic
On Jan 6, 2008 3:19 PM, Bert Freudenberg <[hidden email]
> wrote:
_______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
And to get the inspector (if you didn't know), you can start with the
red menu halo, go to debug, and then choose inspect morph. On Jan 6, 2008 5:16 PM, David Zmick <[hidden email]> wrote: > ya, an inspector works, you can also use the halo to change some things in > morphic > On Jan 6, 2008 3:19 PM, Bert Freudenberg <[hidden email] > wrote: > > Actually, the usual way is to open an inspector on the object you > > want to work with, and start sending messages to self. > > _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Free forum by Nabble | Edit this page |