Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

<text-field>

Open abstract instantiable class

Summary

The class of single line text fields.

Superclasses

<text-gadget>

Init-keywords

x-alignment:
An instance of type one-of(#"left", #"right", #"center"). Default value: #"left".

case:
An instance of type one-of(#f, #"lower", #"upper"). Default value: #f.

auto-scroll?:
An instance of type <boolean>. Default value: #f.

Library

duim-gadgets

Module

duim-gadgets

Description

The class of single line text fields.

Figure 8.42 A text field

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.

Operations

None.

Example

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));

See also

<password-field>, page 624


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index