AsciiSink Object


Application Header file <Xraw/AsciiSink.h>
Class Header file <Xraw/AsciiSinkP.h>
Class asciiSinkObjectClass
Class Name AsciiSink
Superclass TextSink --> Object --> RectObj

The AsciiSink object is used by a text widget to render the text. It will display all Latin1 Characters in an 8 bit font, Tab and Carriage Return. The name may be a bit misleading, but is left this way for compatibility. This object also reports the text window metrics to the text widgets.


New Resources

When creating an AsciiSink object instance, the following resources are retrieved from the argument list or from the resource database:

Name Class Type Notes Default Value
background Background Pixel XtDefaultBackground
destroyCallback Callback XtCallbackList NULL
displayNonprinting Output Boolean True
echo Output Boolean True
font Font XFontStruct* XtDefaultFont
foreground Foreground Pixel XtDefaultForeground


Customizing the Text Widget

The remainder of this chapter will describe customizing the Text widget. The Text widget may be customized by subclassing, or by creating new sources and sinks. Subclassing is described in detail in Chapter 7, this section will describe only those things that are specific to the Text wid get. Attributes of the Text widget base class and creating new sources and sinks will be discussed.

The Text widget is made up of a number of different pieces, with the Text widget as the base wid get class. It and the AsciiText widget are the only true "widgets" in the Text widget family. The other pieces (sources and sinks) are X Toolkit objects and have no window associated with them. No source or sink is useful unless assigned to a Text widget. Each of the following pieces of the Text widget has a specific purpose, and will be, or has been, discussed in detail in this chapter:
Text This is the glue that binds everything else together. This widget reads the text data from the source, and displays the information in the sink. All translations and actions are handled in the Text widget itself.
TextSink This object is responsible for displaying and clearing the drawing area. It also reports the configuration of the window that contains the drawing area. The TextSink does not have its own window, instead it does its drawing on the Text widget's window.
TextSrc This object is responsible for reading, editing and searching through the text buffer. This buffer can be any source of information that this particular TextSrc knows how to read.
AsciiSink This object is a subclass of the TextSink and knows how to display ASCII text. Support has been added to display 8-bit characters.
AsciiSrc This object is a subclass of the TextSrc and knows how to read strings and files.
AsciiText This widget is a subclass of the Text widget that automatically attaches an AsciiSrc and AsciiSink to itself at creation time. This widget provides the simplest interface to the Athena Text widgets.


[Xraw home] [Xraw widget class hierarchy]
Vladimir T. Romanovski
romsky@hp1.oea.ihep.su