2010-10-31 05:31:11 -06:00
|
|
|
<sect1 id="Customizing_the_Text_Widget">
|
|
|
|
<title>Customizing the Text Widget</title>
|
|
|
|
<para>
|
|
|
|
<!-- .LP -->
|
|
|
|
<!-- .XS -->
|
|
|
|
<!-- Customizing the Text Widget -->
|
|
|
|
<!-- .XE -->
|
|
|
|
<!-- .IN "Text widget" "customizing" "@DEF@" -->
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<!-- .LP -->
|
2010-04-23 13:37:47 -06:00
|
|
|
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 widget. Attributes of the Text widget base
|
|
|
|
class and creating new sources and sinks will be discussed.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<!-- .LP -->
|
2010-04-23 13:37:47 -06:00
|
|
|
The Text widget is made up of a number of different pieces, with the
|
|
|
|
Text widget as the base widget 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.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<!-- .LP -->
|
2010-04-23 13:37:47 -06:00
|
|
|
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:
|
2010-10-31 05:31:11 -06:00
|
|
|
<!-- .IN "Text widget" "" -->
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>Text</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
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.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<!-- .IN "TextSink object" "" -->
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>TextSink</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
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.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<!-- .IN "TextSrc object" "" -->
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>TextSrc</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
This object is responsible for reading, editing and searching through the
|
|
|
|
text buffer.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<!-- .IN "AsciiSink object" "" -->
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>AsciiSink</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
This object is a subclass of the TextSink and knows how to display
|
|
|
|
ASCII text. Support has been added to display any 8-bit character set, given
|
|
|
|
the font.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<!-- .IN "MultiSink object" "" -->
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>MultiSink</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
This object is a subclass of the TextSink and knows how to display
|
|
|
|
font sets.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<!-- .IN "AsciiSrc object" "" -->
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>AsciiSrc</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
This object is a subclass of the TextSrc and knows how to read strings
|
|
|
|
and files.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<!-- .IN "MultiSrc object" "" -->
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>MultiSrc</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
This object is a subclass of the TextSrc and knows how to read strings
|
|
|
|
and multibyte files, converting them to wide characters based on locale.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<!-- .IN "AsciiText widget" "" -->
|
|
|
|
<varlistentry>
|
|
|
|
<term><function>AsciiText</function></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-23 13:37:47 -06:00
|
|
|
This widget is a subclass of the Text widget. When created, the AsciiText
|
|
|
|
automatically creates and attaches either an AsciiSrc and AsciiSink, or a
|
|
|
|
MultiSrc and MultiSink, to itself. The AsciiText provides the simplest
|
|
|
|
interface to the Athena Text widgets.
|
2010-10-31 05:31:11 -06:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</sect1>
|