Recent Changes - Search:

OtherPlaces

PmWiki

pmwiki.org

edit SideBar

TextFields

In the sample code, there are small text fields next to buttons. Pressing the button changes the value of the underlying variable to what is typed in the box (assuming it is a valid entry).

For example in rowBumpTemp, there is assignment to bumpTemp:

    bumpTemp := dialog newTextEntryFor: (ValueHolder new contents: myControl
    therm bumpTemp)
      getText: #contents setText: #contents: help: 'This is the random shift'.

Don't confuse this bumpTemp with the bumpTemp in MyTherm. This is a MyGUI variable. In a future version, I will rename the MyGUI variables and patch the code to avoid this ambiguity.

The text in MyGUI bumpTemp can be extracted by:

    bumpTemp getText 

Look in MyGui >> setBumpText. This code is much longer because it has to validate that the entry is convertible into a number (integer or float).

The text in MyGUI bumpTemp can be changed by:

   bumpTemp setText: myControl therm bumpTempD asString.

That code looks in the MyTherm instance (stored in the MyControl instance in the variable 'therm', finds the variable 'bumpTempD', and converts it to a string. Then that string is put into the MyGUI bumptext field, using setText:aString.

Edit - History - Print - Recent Changes - Search
Page last modified on May 01, 2011, at 11:21 AM