1<sect1 id="Customizing_the_Text_Widget">
2<title>Customizing the Text Widget</title>
3<para>
4<!-- .LP -->
5<!-- .XS -->
6<!-- 	Customizing the Text Widget -->
7<!-- .XE -->
8<indexterm significance="preferred"><primary>Text widget</primary><secondary>customizing</secondary></indexterm>
9</para>
10<para>
11<!-- .LP -->
12The remainder of this chapter will describe customizing the Text
13widget.  The Text widget may be customized by subclassing, or by
14creating new sources and sinks.  Subclassing is described in
15detail in Chapter 7; this section will describe only those things that
16are specific to the Text widget.  Attributes of the Text widget base
17class and creating new sources and sinks will be discussed.
18</para>
19<para>
20<!-- .LP -->
21The Text widget is made up of a number of different pieces, with the
22Text widget as the base widget class.  It and the AsciiText widget are
23the only true "widgets" in the Text widget family.  The other pieces
24(sources and sinks) are X Toolkit objects and have no window
25associated with them.  No source or sink is useful unless assigned to
26a Text widget.
27</para>
28<para>
29<!-- .LP -->
30Each of the following pieces of the Text widget has a specific purpose,
31and will be, or has been, discussed in detail in this chapter:
32<indexterm><primary>Text widget</primary></indexterm>
33</para>
34<para>
35<variablelist>
36  <varlistentry>
37    <term><function>Text</function></term>
38    <listitem>
39      <para>
40This is the glue that binds everything else together.  This widget reads
41the text data from the source, and displays the information in the sink.
42All translations and actions are handled in the Text widget itself.
43      </para>
44    </listitem>
45  </varlistentry>
46  <varlistentry>
47    <term><function>TextSink</function></term>
48    <listitem>
49      <para>
50<indexterm><primary>TextSink object</primary></indexterm>
51This object is responsible for displaying and clearing the drawing area.
52It also reports the configuration of the window that contains the
53drawing area.  The TextSink does not have its own window; instead it does
54its drawing on the Text widget's window.
55      </para>
56    </listitem>
57  </varlistentry>
58  <varlistentry>
59    <term><function>TextSrc</function></term>
60    <listitem>
61      <para>
62<indexterm><primary>TextSrc object</primary></indexterm>
63This object is responsible for reading, editing and searching through the
64text buffer.
65      </para>
66    </listitem>
67  </varlistentry>
68  <varlistentry>
69    <term><function>AsciiSink</function></term>
70    <listitem>
71      <para>
72<indexterm><primary>AsciiSink object</primary></indexterm>
73This object is a subclass of the TextSink and knows how to display
74ASCII text.  Support has been added to display any 8-bit character set, given
75the font.
76      </para>
77    </listitem>
78  </varlistentry>
79  <varlistentry>
80    <term><function>MultiSink</function></term>
81    <listitem>
82      <para>
83<indexterm><primary>MultiSink object</primary></indexterm>
84This object is a subclass of the TextSink and knows how to display
85font sets.
86      </para>
87    </listitem>
88  </varlistentry>
89  <varlistentry>
90    <term><function>AsciiSrc</function></term>
91    <listitem>
92      <para>
93<indexterm><primary>AsciiSrc object</primary></indexterm>
94This object is a subclass of the TextSrc and knows how to read strings
95and files.
96      </para>
97    </listitem>
98  </varlistentry>
99  <varlistentry>
100    <term><function>MultiSrc</function></term>
101    <listitem>
102      <para>
103<indexterm><primary>MultiSrc object</primary></indexterm>
104This object is a subclass of the TextSrc and knows how to read strings
105and multibyte files, converting them to wide characters based on locale.
106      </para>
107    </listitem>
108  </varlistentry>
109  <varlistentry>
110    <term><function>AsciiText</function></term>
111    <listitem>
112      <para>
113<indexterm><primary>AsciiText widget</primary></indexterm>
114This widget is a subclass of the Text widget.  When created, the AsciiText
115automatically creates and attaches either an AsciiSrc and AsciiSink, or a
116MultiSrc and MultiSink, to itself.  The AsciiText provides the simplest
117interface to the Athena Text widgets.
118      </para>
119    </listitem>
120  </varlistentry>
121</variablelist>
122</para>
123</sect1>
124