Specifications
Athena Widget Set libXaw 1.0.7
w Specifies the TextSrc object.
start Specifies the position of the first character to be removedfrom the text buffer.
This is also the location to begin inserting the newtext.
end Specifies the position immediately after the last character to be removedfrom the
text buffer.
text Specifies the text to be added to the text source.
This function can return anyofthe following values:
XawEditDone The text replacement was successful.
XawPositionError The edit mode is XawtextAppend and start is not the last character of the
source.
XawEditError Either the Source was read-only or the range to be deleted is larger than the
length of the Source.
The Replace arguments start and end represent the text source character positions for the existing
text that is to be replaced by the text in the text block. The characters from start up to but not
including end are deleted, and the buffer specified by the text block is inserted in their place. If
start and end are equal, no text is deleted and the newtextisinserted after start.
5.10.2.3. Scanning the TextSrc
To search the text source for one of the predefined boundary types use the Scan function:
XawTextPosition Scan(w, position, type, dir, count, include)
Widget w;
XawTextPosition position;
XawTextScanType type;
XawTextScanDirection dir;
int count;
Boolean include;
w Specifies the TextSrc object.
position Specifies the position to begin scanning the source.
type Specifies the type of boundary to scan for,may be one of: XawstPosition, Xaw-
stWhiteSpace, XawstEOL, XawstParagraph, XawstAll.The exact meaning
of these boundaries is left up to the individual text source.
dir Specifies the direction to scan, may be either XawsdLeft to search backward, or
XawsdRight to search forward.
count Specifies the number of boundaries to scan for.
include Specifies whether the boundary itself should be included in the scan.
The Scan function returns the position in the text source of the desired boundary.Itisexpected to
return a valid address for all calls made to it, thus if a particular request is made that would take
the text widget beyond the end of the source it must return the position of that end.
5.10.2.4. Searching through a TextSrc
To search for a particular string use the Search function.
XawTextPosition Search(w, position, dir, text)
Widget w;
XawTextPosition position;
XawTextScanDirection dir;
XawTextBlock *text;
w Specifies the TextSrc object.
101