(back to index)
Single line text input field.
Inherits from Input_
Subclasses: Float_Input Int_Input Multiline_Input Secret_Input
This is the FLTK text input widget. It displays a single line of
text and lets the user edit it. Normally it is drawn with an inset
box and a white background. The text may contain any characters (even
0), and will correctly display anything, using ^X notation for
unprintable control characters and \nnn notation for unprintable
characters with the high bit set. It assummes the font can draw any
characters in the ISO8859-1 character set.
The when property controls when callbacks are performed.
The following values are useful:
The default is When.release.
- When.never: The callback is not done, but changed is
- When.changed: The callback is done each time the text
is changed by the user.
- When.release: The callback will be done when this
widget loses the focus, including when the window is unmapped. This
is a useful value for text fields in a panel where doing the callback
on every change is wasteful. However the callback will also happen if
the mouse is moved out of the window, which means it should not do
anything visible (like pop up an error message). You might do better
setting this to zero, and scanning all the items for changed
when the OK button on a panel is pressed.
- When.enter_key: If the user types the Enter key, the
entire text is selected, and the callback is done if the text has
changed. Normally the Enter key will navigate to the next field (or
insert a newline for a Mulitline_Input), this changes the
- When.enter_key + When.not_changed: The Enter key will
do the callback even if the text has not changed. Useful for command
doctool generated at Sun Aug 12 22:23:18 2001