1994689c1Smrg<sect1 id="Customizing_the_Text_Widget">
2994689c1Smrg<title>Customizing the Text Widget</title>
3994689c1Smrg<para>
4994689c1Smrg<!-- .LP -->
5994689c1Smrg<!-- .XS -->
6994689c1Smrg<!-- 	Customizing the Text Widget -->
7994689c1Smrg<!-- .XE -->
85ec34c4cSmrg<indexterm significance="preferred"><primary>Text widget</primary><secondary>customizing</secondary></indexterm>
9994689c1Smrg</para>
10994689c1Smrg<para>
11994689c1Smrg<!-- .LP -->
12994689c1SmrgThe remainder of this chapter will describe customizing the Text
13994689c1Smrgwidget.  The Text widget may be customized by subclassing, or by
14994689c1Smrgcreating new sources and sinks.  Subclassing is described in
15994689c1Smrgdetail in Chapter 7; this section will describe only those things that
16994689c1Smrgare specific to the Text widget.  Attributes of the Text widget base
17994689c1Smrgclass and creating new sources and sinks will be discussed.
18994689c1Smrg</para>
19994689c1Smrg<para>
20994689c1Smrg<!-- .LP -->
21994689c1SmrgThe Text widget is made up of a number of different pieces, with the
22994689c1SmrgText widget as the base widget class.  It and the AsciiText widget are
23994689c1Smrgthe only true "widgets" in the Text widget family.  The other pieces
24994689c1Smrg(sources and sinks) are X Toolkit objects and have no window
25994689c1Smrgassociated with them.  No source or sink is useful unless assigned to
26994689c1Smrga Text widget.
27994689c1Smrg</para>
28994689c1Smrg<para>
29994689c1Smrg<!-- .LP -->
30994689c1SmrgEach of the following pieces of the Text widget has a specific purpose,
31994689c1Smrgand will be, or has been, discussed in detail in this chapter:
325ec34c4cSmrg<indexterm><primary>Text widget</primary></indexterm>
33994689c1Smrg</para>
34994689c1Smrg<para>
35994689c1Smrg<variablelist>
36994689c1Smrg  <varlistentry>
37994689c1Smrg    <term><function>Text</function></term>
38994689c1Smrg    <listitem>
39994689c1Smrg      <para>
40994689c1SmrgThis is the glue that binds everything else together.  This widget reads
41994689c1Smrgthe text data from the source, and displays the information in the sink.
42994689c1SmrgAll translations and actions are handled in the Text widget itself.
43994689c1Smrg      </para>
44994689c1Smrg    </listitem>
45994689c1Smrg  </varlistentry>
46994689c1Smrg  <varlistentry>
47994689c1Smrg    <term><function>TextSink</function></term>
48994689c1Smrg    <listitem>
49994689c1Smrg      <para>
505ec34c4cSmrg<indexterm><primary>TextSink object</primary></indexterm>
51994689c1SmrgThis object is responsible for displaying and clearing the drawing area.
52994689c1SmrgIt also reports the configuration of the window that contains the
53994689c1Smrgdrawing area.  The TextSink does not have its own window; instead it does
54994689c1Smrgits drawing on the Text widget's window.
55994689c1Smrg      </para>
56994689c1Smrg    </listitem>
57994689c1Smrg  </varlistentry>
58994689c1Smrg  <varlistentry>
59994689c1Smrg    <term><function>TextSrc</function></term>
60994689c1Smrg    <listitem>
61994689c1Smrg      <para>
625ec34c4cSmrg<indexterm><primary>TextSrc object</primary></indexterm>
63994689c1SmrgThis object is responsible for reading, editing and searching through the
64994689c1Smrgtext buffer.
65994689c1Smrg      </para>
66994689c1Smrg    </listitem>
67994689c1Smrg  </varlistentry>
68994689c1Smrg  <varlistentry>
69994689c1Smrg    <term><function>AsciiSink</function></term>
70994689c1Smrg    <listitem>
71994689c1Smrg      <para>
725ec34c4cSmrg<indexterm><primary>AsciiSink object</primary></indexterm>
73994689c1SmrgThis object is a subclass of the TextSink and knows how to display
74994689c1SmrgASCII text.  Support has been added to display any 8-bit character set, given
75994689c1Smrgthe font.
76994689c1Smrg      </para>
77994689c1Smrg    </listitem>
78994689c1Smrg  </varlistentry>
79994689c1Smrg  <varlistentry>
80994689c1Smrg    <term><function>MultiSink</function></term>
81994689c1Smrg    <listitem>
82994689c1Smrg      <para>
835ec34c4cSmrg<indexterm><primary>MultiSink object</primary></indexterm>
84994689c1SmrgThis object is a subclass of the TextSink and knows how to display
85994689c1Smrgfont sets.
86994689c1Smrg      </para>
87994689c1Smrg    </listitem>
88994689c1Smrg  </varlistentry>
89994689c1Smrg  <varlistentry>
90994689c1Smrg    <term><function>AsciiSrc</function></term>
91994689c1Smrg    <listitem>
92994689c1Smrg      <para>
935ec34c4cSmrg<indexterm><primary>AsciiSrc object</primary></indexterm>
94994689c1SmrgThis object is a subclass of the TextSrc and knows how to read strings
95994689c1Smrgand files.
96994689c1Smrg      </para>
97994689c1Smrg    </listitem>
98994689c1Smrg  </varlistentry>
99994689c1Smrg  <varlistentry>
100994689c1Smrg    <term><function>MultiSrc</function></term>
101994689c1Smrg    <listitem>
102994689c1Smrg      <para>
1035ec34c4cSmrg<indexterm><primary>MultiSrc object</primary></indexterm>
104994689c1SmrgThis object is a subclass of the TextSrc and knows how to read strings
105994689c1Smrgand multibyte files, converting them to wide characters based on locale.
106994689c1Smrg      </para>
107994689c1Smrg    </listitem>
108994689c1Smrg  </varlistentry>
109994689c1Smrg  <varlistentry>
110994689c1Smrg    <term><function>AsciiText</function></term>
111994689c1Smrg    <listitem>
112994689c1Smrg      <para>
1135ec34c4cSmrg<indexterm><primary>AsciiText widget</primary></indexterm>
114994689c1SmrgThis widget is a subclass of the Text widget.  When created, the AsciiText
115994689c1Smrgautomatically creates and attaches either an AsciiSrc and AsciiSink, or a
116994689c1SmrgMultiSrc and MultiSink, to itself.  The AsciiText provides the simplest
117994689c1Smrginterface to the Athena Text widgets.
118994689c1Smrg      </para>
119994689c1Smrg    </listitem>
120994689c1Smrg  </varlistentry>
121994689c1Smrg</variablelist>
122994689c1Smrg</para>
123994689c1Smrg</sect1>
124