Specifications

Athena Widget Set libXaw 1.0.7
5.11. TextSink Object
Application Header file <X11/Xaw/TextSink.h>
Class Header file <X11/Xaw/TextSinkP.h>
Class textSinkObjectClass
Class Name Te x tSink
Superclass Object
The TextSink object is the root object for all text sinks. Anynew textsink objects should be sub-
classes of the TextSink Object. The TextSink Class contains all methods that the Textwidget
expects a text sink to export.
Since all text sinks will have some resources in common, the TextSink defines a fewnew
resources.
5.11.1. Resources
When creating an TextSink object instance, the following resources are retrievedfrom the argu-
ment list or from the resource database:
Name Class Type Notes Default Value
background Background Pixel XtDefaultBackground
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
background Apixel value which indexesthe widget’scolormap to derive the back-
ground color of the widget’swindow.
destroyCallback All functions on this list are called when this widget is destroyed.
foreground Apixel value which indexesthe Textwidget’scolormap to derive the
foreground color used by the text sink.
5.11.2. Subclassing the TextSink
The only purpose of the TextSink Object is to be subclassed. It contains the minimum set of class
methods that all text sinks must have.While all may be inherited, the direct descendant of
Te x tSink must specify some of them as TextSink does contain enough information to be a valid
text sink by itself. Do not try to use the TextSink as a valid sink for the Textwidget; it is not
intended to be used as a sink by itself.
Function Inherit with Public Interface must specify
DisplayTextXtInheritDisplayTextXawTe xtSinkDisplayTextyes
InsertCursor XtInheritInsertCursor XawTextSinkInsertCursor yes
ClearToBackground XtInheritClearToBackground XawTextSinkClearToBackground no
FindPosition XtInheritFindPosition XawTextSinkFindPosition yes
FindDistance XtInheritFindDistance XawTextSinkFindDistance yes
ResolveXtInheritResolveXawTe xtSinkResolveyes
MaxLines XtInheritMaxLines XawTextSinkMaxLines no
MaxHeight XtInheritMaxHeight XawTextSinkMaxHeight no
SetTabs XtInheritSetTabs XawTextSinkSetTabs no
GetCursorBounds XtInheritGetCursorBounds XawTextSinkGetCursorBounds yes
5.11.2.1. Displaying Text
To display a section of the text buffer contained in the text source use the function DisplayText:
103