Specifications
Athena Widget Set libXaw 1.0.7
Chapter 5
Text Widgets
The Textwidget provides a windowthat will allowanapplication to display and edit one or more
lines of text. Options are provided to allowthe user to add Scrollbars to its window, search for a
specific string, and modify the text in the buffer.
The Textwidget is made up of a number of pieces; it was modularized to ease customization.
The AsciiTextwidget class (actually not limited to ASCII but so named for compatibility) is be
general enough to most needs. If more flexibility,special features, or extra functionality is
needed, theycan be added by implementing a newTextSource or TextSink, or by subclassing the
Te x tWidget (See Section 5.8 for customization details.)
The words insertion point are used in this chapter to refer to the text caret. This is the symbol
that is displayed between twocharacters in the file. The insertion point marks the location where
anynew characters will be added to the file. To avoid confusion the pointer cursor will always be
referred to as the pointer.
The text widget supports three edit modes, controlling the types of modifications a user is allowed
to make:
•Append-only
•Editable
•Read-only
Read-only mode does not allowthe user or the programmer to modify the text in the widget.
While the entire string may be reset in read-only mode with XtSetValues,itcannot be modified
via with XawTextReplace.Append-only and editable modes allowthe text at the insertion point
to be modified. The only difference is that text may only be added to or removedfrom the end of
abuffer in append-only mode.
5.1. Text Widget for Users
The Textwidget provides manyofthe common keyboard editing commands. These commands
allowusers to move around and edit the buffer.Ifanillegaloperation is attempted, (such as delet-
ing characters in a read-only text widget), the X server will beep.
5.1.1. Default KeyBindings
The default key bindings are patterned after those in the EMACS text editor:
Ctrl-a Beginning Of Line Meta-b Backward Word
Ctrl-b Backward Character Meta-f Forward Word
Ctrl-d Delete Next Character Meta-i Insert File
Ctrl-e End Of Line Meta-k Kill To End Of Paragraph
Ctrl-f Forward Character Meta-q Form Paragraph
Ctrl-g Multiply Reset Meta-v Previous Page
Ctrl-h Delete Previous Character Meta-y Insert Current Selection
Ctrl-j Newline And Indent Meta-z Scroll One Line Down
Ctrl-k Kill To End Of Line Meta-d Delete Next Word
Ctrl-l RedrawDisplay Meta-D Kill Word
Ctrl-m Newline Meta-h Delete Previous Word
Ctrl-n Next Line Meta-H Backward Kill Word
72