Specifications
Athena Widget Set libXaw 1.0.7
ptr Contains the string to be referenced by the Textwidget.
format This flag indicates whether the data pointed to by ptr is char or wchar_t. When
the associated widget has international set to false this field must be
XawFmt8Bit. When the associated widget has international set to true this field
must be either XawFmt8Bit or XawFmtWide.
Note: Previous versions of Xawused FMT8BIT,which has been retained for backwards compat-
ibility. FMT8BIT is deprecated and will eventually be removedfrom the implementation.
5.4.1. Selecting Text
To select a piece of text, use XawTextSetSelection:
void XawTextSetSelection(w, left, right)
Widget w;
XawTextPosition left, right;
w Specifies the Textwidget.
left Specifies the character position at which the selection begins.
right Specifies the character position at which the selection ends.
See section 5.4 for a description of XawTextPosition.Ifredisplay is enabled, this function high-
lights the text and makes it the PRIMARY selection. This function does not have any effect on
CUT_BUFFER0.
5.4.2. Unhighlighting Text
To unhighlight previously highlighted text in a widget, use XawTextUnsetSelection:
void XawTextUnsetSelection(w)
Widget w;
w Specifies the Textwidget.
5.4.3. Getting Current Text Selection
To retrieve the text that has been selected by this text widget use XawTextGetSelectionPos:
void XawTextGetSelectionPos(w, begin_return, end_return)
Widget w;
XawTextPosition *begin_return,*end_return;
w Specifies the Textwidget.
begin_return Returns the beginning of the text selection.
end_return Returns the end of the text selection.
See section 5.4 for a description of XawTextPosition.Ifthe returned values are equal, no text is
currently selected.
5.4.4. Replacing Text
To modify the text in an editable Textwidget use XawTextReplace:
int XawTextReplace(w, start, end, text)
Widget w;
XawTextPosition start, end;
XawTextBlock *text;
w Specifies the Textwidget.
start Specifies the starting character position of the text replacement.
83