|
James O'Brien-3 |
|
|
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? _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
|
Sean P. DeNigris |
|
|
If you mean an existing TextMorph, see SimpleButtonMorph's class comment. There is an example that you can easily adapt. |
|
James O'Brien-3 |
|
|
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 > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
|
Sean P. DeNigris |
|
|
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.) |
|
|
Sean P. DeNigris wrote:
Here is a write up of something interesting I found to access existing morphsJames O'Brien-3 wrote http://blog.openinworld.com/2011/04/workspace-referencing-to-existing-morphs/ _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
| Powered by Nabble | See how NAML generates this page |