[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Programmer's Guide

Text and TextField

The Text widget uses the type String. A TextField is essentially the same as a Text widget in single-line mode, except that its performance is optimized for single-line text operations. Although TextField has a complete set of convenience routines of its own, the widget argument to the Text convenience routines can be either a Text or a TextField widget.

The text in a Text widget can be multiline or constrained to be a single line, depending on the value of the XmNeditMode resource. In multiline Text, pressing osfUp moves the insertion cursor, the point at which new text is inserted, physically upward, and pressing osfDown moves the insertion cursor physically downward. Other actions move the insertion cursor forward and backward by paragraphs. Pressing Space, Tab, or Enter causes the corresponding character to be inserted into the text. For this reason, some action key bindings are different in Text from those in other widgets, as shown in Table 6.

Table 6. Text Action Key Bindings

Action Actual Key Events
Activate Ctrl<Key>Return

Extend Ctrl Shift<Key>space

NextField Ctrl<Key>Tab
Select Ctrl<Key>space


In a single-line widget, pressing Space still inserts a space into the text. However, osfUp and osfDown now move keyboard focus to the previous or next traversable widget, and Tab traverses to the next tab group. Enter invokes the XmNactivateCallback callbacks. The actions for moving by paragraphs have no effect. In other words, a single-line Text widget acts more as a simple control than a field control.


Asian languages are supported by vertical writing capabilities; for detailed information, refer to the reference pages for the following interfaces: XmText, XmTextField, XmTextGetBaseline, XmTextGetCenterline, XmTextPosToXY, XmTextXYToPos, and XmTextScroll.

[ Previous | Next | Contents | Glossary | Home | Search ]