src/swipl-devel/packages/xpce/man/refmanual/md/text_item.md

class text_item {#class-text_item}

A text_item is a entry field for a short text. It is normally used in dialog windows for entering names or other short textual information. A text_item consists of a label, and an entry field. The label is fixed. The user may type in the entry field.

When the user hits RETURN, the text_item will forward the current <-selection over the associated <-message with the following arguments:

| @receiver | The text_item         |
| @arg1     | The current selection |

Text_item's may used to edit/examine any PCE type that defines a object <-print_name and an object <-convert which allows the item to convert a typed textual representation into an object of the requested type. See <-type.

If is possible to generate a set of possible completions for a partially typed text, the text_item may be programmed to perform automatic completion. See ->complete.

The mapping from key-strokes to edit actions is determined by the reusable key_binding object named text_item, a reference to which may be obtained using:

?- new(KB, key_binding(text_item)).

See also class label and class int_item.

Bugs:

It is not possible to detect the user typed something before the RETURN or ESCAPE otherwise than creating a subclass and redefining the ->event method.

@see class key_binding @see text->typed @see class slider @see class text

Instance variables {#class-text_item-instvars}

Send methods {#class-text_item-send}

Get methods {#class-text_item-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.