[Newbies] Re: Sending messages

Sean P. DeNigris sean at clipperadams.com
Fri Dec 30 23:54:07 UTC 2011

James O'Brien-3 wrote
> SimpleButtonMorph's class comment, would the target be the TextMorph? If 
> so, how is the correct TextMorph identified if there are two or more of 
> them?

Yes, you'd need access to the TextMorph instance, and write something like:
button := SimpleButtonMorph newWithLabel: 'change text'.
	target: tm;
		actionSelector: #contents:;
		arguments: #('new text'); 

If you didn't create the TextMorph and can't get access to it, you can find
it by searching through the world's submorphs (recursively if nec.)

View this message in context: http://forum.world.st/Sending-messages-tp4244002p4247218.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.

More information about the Beginners mailing list