How to access a text entry?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to access a text entry?

I am trying to model a simple GUI from the UITheme class exampleBasicControls.
In that method, there's this:

  'Text Entry'->(dialog newTextEntryFor: (ValueHolder new contents: 'Hello')
   getText: #contents setText: #contents: help: 'This is a text entry').

which creates a textbox, with the default value of 'Hello'.

How do I access what's typed into the 'Hello' area so I can use it in code?

I'd like to use it this way:
1) enter something into the box.
2) when done, click a button which does something with the new value
(but I don't want to close the window).  

For example, I type in '33' and click a button.
Some code receives that value and adds 1 to it, then
prints out the result 34 on the Transcript.