Get current value of a GUI element
getvalue control
Returns value or state of a control. For the following types it is:
- label and text box: word (string equal to the result of gettext
instruction);
- button: boolean value true
if button is pushed, false
if it is released;
- checkbox: boolean value true
if it is checked, false
if it is clear;
- slider: number, the current position of the slider.
Example:
"s := (slider "Slider {10 20} {0 10 0.5} 3)
setonchange :s [print getvalue :s]
Output:
Slider in the graphics window. Current value of the slider is written to the text output on each change.
3
3.5
4
4.5
5
5.5
...
See also:
Table of Content