12.07.2015 Views

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5. Text <strong>Widget</strong>sThe Text widget provides a window that will allow an application to display and editone or more lines of text. Options are provided to allow the user to add Scrollbarsto its window, search for a specific string, and modify the text in the buffer.The Text widget is made up of a number of pieces; it was modularized to ease customization.The AsciiText widget class (actually not limited to ASCII but so namedfor compatibility) is be general enough to most needs. If more flexibility, specialfeatures, or extra functionality is needed, they can be added by implementing a newTextSource or TextSink, or by subclassing the Text <strong>Widget</strong> (See Section 5.8 for customizationdetails.)The words insertion point are used in this chapter to refer to the text caret. This isthe symbol that is displayed between two characters in the file. The insertion pointmarks the location where any new characters will be added to the file. To avoidconfusion the pointer cursor will always be referred to as the pointer.The text widget supports three edit modes, controlling the types of modificationsa user is allowed to make:• Append-only• Editable• Read-onlyRead-only mode does not allow the user or the programmer to modify the text in thewidget. While the entire string may be reset in read-only mode with Xt<strong>Set</strong>Values,it cannot be modified via with XawTextReplace. Append-only and editable modesallow the text at the insertion point to be modified. The only difference is that textmay only be added to or removed from the end of a buffer in append-only mode.Text <strong>Widget</strong> for UsersThe Text widget provides many of the common keyboard editing commands. Thesecommands allow users to move around and edit the buffer. If an illegal operationis attempted, (such as deleting characters in a read-only text widget), the X serverwill beep.Default Key BindingsThe default key bindings are patterned after those in the EMACS text editor:Ctrl-a Beginning Of Line Meta-b Backward WordCtrl-b Backward Character Meta-f Forward WordCtrl-d Delete Next Character Meta-i Insert FileCtrl-e End Of Line Meta-k Kill To End Of ParagraphCtrl-f Forward Character Meta-q Form ParagraphCtrl-g Multiply Reset Meta-v Previous Page64

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!