Open abstract instantiable class
The class of single line text fields.
x-alignment:one-of(#"left", #"right", #"center"). Default value: #"left".
case:one-of(#f, #"lower", #"upper"). Default value: #f.
auto-scroll?:<boolean>. Default value: #f.
duim-gadgets
duim-gadgets
The class of single line text fields.
|
The x-alignment: init-keyword is used to align the text in the text field.
The case: init-keyword lets you specify which case is used to display the text in the text field. You can specify either upper or lower case. The default is to display letters of either case.
If auto-scroll?: is true, then text scrolls off to the left of the text field if more text is typed than can be displayed in the text field itself.
Internally, this class maps into the single-line edit control Windows control.
To make a text field with a fixed width:
make(<text-field>, width: 200, fixed-width?: #t);
The following example creates a text field which, after pressing Return, invokes a callback that displays the gadget value in a dialog box.
*text* := contain
(make(<text-field>,
value-changed-callback:
method (gadget)
notify-user
(format-to-string
("Changed to %=",
gadget-value(gadget)),
owner: gadget) end)); <password-field>, page 624