[Newbies] Sending messages

James O'Brien obrienjs at comcast.net
Fri Jun 15 15:12:44 UTC 2012

I typed the following in a workspace and created a rectangle:
FirstBox := RectangleMorph new openInWorld.

I then changed its color:
FirstBox color: Color green.

I next created a system category with a RectangleMorph subclass:
RectangleMorph subclass: #TestBox
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SqueakExperiment'

I then used a workspace to create a new rectangle:
SecondBox := TestBox new openInWorld.

But I could not change its color like I could with the first rectangle: 
SecondBox color: Color green.

How can I change the second rectangle’s color by sending it a message from a workspace?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20120615/53e858ae/attachment.htm

More information about the Beginners mailing list