Set current value of a GUI element

setvalue widget value

Set new value of the widget. The meaning of the value for the following widget types is:

- label and text box: word (string of characters) displayed on the widget (equal to the result of settext instruction);
- checkbox: boolean value true sets state to checked, false clears the checkbox;
- slider: number, the new position of the slider;
- button: button state cannot be changed programmatically.

Example:

"s := (slider "Slider {10 20} {0 10 1})
repeat 10 [
  setvalue :s repcount
  wait 100
]

Output:
Changing value of the slider created in the graphics window.

See also:

Table of Content