Specifications
Athena Widget Set libXaw 1.0.7
Name Class Type Notes Default Value
editType EditType EditMode NULL
destroyCallback All functions on this list are called when this widget is destroyed.
editType This is the type of editing that will be allowed in this text widget. Legal
values are XawtextRead, XawtextEdit,and XawtextAppend.Acon-
verter is registered for this resource that will convert the following
strings: read, edit, and append.
5.10.2. Subclassing the TextSrc
The only purpose of the TextSrc Object is to be subclassed. It contains the minimum set of class
methods that all text sources must have.All class methods of the TextSrc must be defined, as the
Te x twidget uses them all. While all may be inherited, the direct descendant of TextSrc must
specify some of them as TextSrc does not contain enough information to be a valid text source by
itself. Do not try to use the TextSrc as a valid source for the Textwidget; it is not intended to be
used as a source by itself and bad things will probably happen.
Function Inherit with Public Interface must specify
Read XtInheritRead XawTextSourceRead yes
Replace XtInheritReplace XawTextSourceReplace no
Scan XtInheritScan XawTextSourceScan yes
Search XtInheritSearch XawTextSourceSearch no
SetSelection XtInheritSetSelection XawTextSourceSetSelection no
ConvertSelection XtInheritConvertSelection XawTextSourceConvertSelection no
5.10.2.1. Reading Text.
To read the text in a text source use the Read function:
XawTextPosition Read(w, pos, text_return, length)
Widget w;
XawTextPosition pos;
XawTextBlock *text_return;
int length;
w Specifies the TextSrc object.
pos Specifies the position of the first character to be read from the text buffer.
text Returns the text read from the source.
length Specifies the maximum number of characters the TextSrc should return to the
application in text_return.
This function returns the text position immediately after the characters read from the text buffer.
The function is not required to read length characters if that manycharacters are in the file, it may
break at anypoint that is convenient to the internal structure of the source. It may takesev eral
calls to Read before the desired portion of the text buffer is fully retrieved.
5.10.2.2. Replacing Text.
To replace or edit the text in a text buffer use the Replace function:
XawTextPosition Replace(w, start, end, text)
Widget w;
XawTextPosition start, end;
XawTextBlock *text;
100