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



Editable Versus Noneditable Text

When you are writing a widget that displays text, you must decide whether the text will be editable or noneditable. The standard Motif widget set provides two editable text widgets (XmText and XmTextField) and one noneditable text widget (XmLabel).

Editable text is much harder to code than noneditable text. One reason is because widgets with editable text must provide a much larger set of action methods than their noneditable counterparts. For example, a widget with editable text needs to provide actions that allow the user to navigate to different portions of the text. Editable text widgets usually provide actions that allow the user to cut, copy, and paste text. In addition, editable text widgets must support the range selection model. This model allows users to select a contiguous range of elements in a collection. Noneditable widgets need not support any selection model. Consequently, data transfer is much easier to implement in a noneditable text widget than in an editable text widget.

We do not want to discourage you from providing editable text. We merely want to warn you about its complexity.

The ExmString widget demonstrates noneditable text. Motif does not currently provide an Exm demonstration widget that demonstrates editable text.


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