I would like to use a SimpleButtonMorph that, when clicked on, will cause some text to appear in a TextMorph. Any suggestions on how to do this?
James O'Brien-3 wrote
I would like to use a SimpleButtonMorph that, when clicked on, will cause some text to appear in a TextMorph. Any suggestions on how to do this?
If you mean an existing TextMorph, see SimpleButtonMorph's class comment. There is an example that you can easily adapt.
-- View this message in context: http://forum.world.st/Sending-messages-tp4244002p4244142.html Sent from the Squeak - Beginners mailing list archive at Nabble.com.
Yes, there is an existing TextMorph. Using the first example in the 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?
On 12/29/11 2:21 PM, Sean P. DeNigris wrote:
James O'Brien-3 wrote
I would like to use a SimpleButtonMorph that, when clicked on, will cause some text to appear in a TextMorph. Any suggestions on how to do this?
If you mean an existing TextMorph, see SimpleButtonMorph's class comment. There is an example that you can easily adapt.
-- View this message in context:http://forum.world.st/Sending-messages-tp4244002p4244142.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
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'. button target: tm; actionSelector: #contents:; arguments: #('new text'); openInWorld
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.
beginners@lists.squeakfoundation.org