Create a text box

textbox text size

Creates a textbox in the graphics window with the content set to text. Size is a two- or four-element list or array; 1st and 2nd element is the position with respect to the left and top borders of the window, respectively; 3rd and 4th element (if present) is the width and the height of the slider, respectively. Size and location are given in pixels and do not depend on the drawing scales. If location is provided without sizes then width and height of the textbox will be adjusted to the text content.
Current content of the textbox can be obtained with gettext instruction.

Example:

"t := textbox "|initial text| {30 20}
setonchange :t [print gettext :t]

Output:
Textbox is created in the graphics window. The new content is printed in the text output on each change of the textbox content (confirmed with the Enter key or exiting from the textbox).

text
edited text
...

See also:

Table of Content