
An editor application with two different styles of Text widgets
The Text widget supports both single−line and multiline editing. In single−line mode, which is the default mode,
newlines are ignored. However, single−line text entry is usually done with the TextField widget class. This widget
class is a completely separate class, not a subclass, of Text that is lighter−weight because it only supports single−line
text editing. The TextField widget was added to the toolkit in Motif 1.1; in early versions of that release the widget
had a number of bugs that made it difficult to use. These bugs have been fixed in later releases. Although they are two
separate widget classes, the Text and TextField widgets provide many of the same resources and convenience
routines. We will point out the differences as we go, but keep in mind that there are two widget classes so you don't
get confused as we discuss them throughout this chapter.
Since the TextField widget cannot handle multiline editing, you must use the Text widget for this purpose. When
multiple lines are used for editing, the number of lines typically grows and shrinks dynamically as the user edits the
text. The Text widget is often used in a scrollable window, so that the user can view different portions of the
underlying text. The combination of a Text widget and a ScrolledWindow widget is called a ScrolledText object. This
object is not a widget ...