<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gtktextattributes">
  <refnamediv>
    <refname>gtk.TextAttributes</refname>
    <refpurpose>an object containing the attributes set on some
text</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.TextAttributes</classname></ooclass>
      <ooclass><classname>gobject.GBoxed</classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gtktextattributes">gtk.TextAttributes</link></methodname>
	<methodparam></methodparam>  </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextattributes--copy">copy</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextattributes--copy-values">copy_values</link></methodname>
	<methodparam><parameter role="keyword">dest</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"bg_color"</entry>
	      <entry>Read</entry>
	      <entry>The background color</entry>
	    </row>

	    <row valign="top">
	      <entry>"fg_color"</entry>
	      <entry>Read</entry>
	      <entry>The foreground color</entry>
	    </row>

	    <row valign="top">
	      <entry>"bg_stipple"</entry>
	      <entry>Read</entry>
	      <entry>The background stipple bitmap</entry>
	    </row>

	    <row valign="top">
	      <entry>"fg_stipple"</entry>
	      <entry>Read</entry>
	      <entry>The foreground stipple bitmap</entry>
	    </row>

	    <row valign="top">
	      <entry>"rise"</entry>
	      <entry>Read</entry>
	      <entry>The subscript or superscript rise</entry>
	    </row>

	    <row valign="top">
	      <entry>"underline"</entry>
	      <entry>Read</entry>
	      <entry>The style of underline - one of:
<literal>pango.UNDERLINE_NONE</literal>,
<literal>pango.UNDERLINE_SINGLE</literal>,
<literal>pango.UNDERLINE_DOUBLE</literal>,
<literal>pango.UNDERLINE_LOW</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"strikethrough"</entry>
	      <entry>Read</entry>
	      <entry>If <literal>True</literal> strikethrough the text</entry>
	    </row>

	    <row valign="top">
	      <entry>"draw_bg"</entry>
	      <entry>Read</entry>
	      <entry>If <literal>True</literal> some background attributes
are set</entry>
	    </row>

	    <row valign="top">
	      <entry>"justification"</entry>
	      <entry>Read</entry>
	      <entry>The type of justification - one of:
<literal>gtk.JUSTIFY_LEFT</literal>, <literal>gtk.JUSTIFY_RIGHT</literal>,
<literal>gtk.JUSTIFY_CENTER</literal>,
<literal>gtk.JUSTIFY_FILL</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"direction"</entry>
	      <entry>Read</entry>
	      <entry>The text direction - one of:
<literal>gtk.TEXT_DIR_NONE</literal>, <literal>gtk.TEXT_DIR_LTR</literal>,
<literal>gtk.TEXT_DIR_RTL</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"font"</entry>
	      <entry>Read</entry>
	      <entry>A <classname>pango.FontDescription</classname></entry>
	    </row>

	    <row valign="top">
	      <entry>"font_scale"</entry>
	      <entry>Read</entry>
	      <entry>The scale of the font e.g. 2.5</entry>
	    </row>

	    <row valign="top">
	      <entry>"left_margin"</entry>
	      <entry>Read</entry>
	      <entry>The width of the left margin in pixels</entry>
	    </row>

	    <row valign="top">
	      <entry>"indent"</entry>
	      <entry>Read</entry>
	      <entry>The width of the paragraph indent in pixels</entry>
	    </row>

	    <row valign="top">
	      <entry>"right_margin"</entry>
	      <entry>Read</entry>
	      <entry>The width of the right margin</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels_above_lines"</entry>
	      <entry>Read</entry>
	      <entry>The number of pixels space above a paragraph</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels_below_lines"</entry>
	      <entry>Read</entry>
	      <entry>The number of pixels space below a paragraph</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels_inside_wrap"</entry>
	      <entry>Read</entry>
	      <entry>The number of pixels of space between wrapped lines in
a paragraph</entry>
	    </row>

	    <row valign="top">
	      <entry>"tabs"</entry>
	      <entry>Read</entry>
	      <entry>A set of tabs contained in a
<classname>pango.TabArray</classname></entry>
	    </row>

	    <row valign="top">
	      <entry>"wrap_mode"</entry>
	      <entry>Read</entry>
	      <entry>The wrap mode - one of: <literal>gtk.WRAP_NONE</literal>,
  <literal>gtk.WRAP_CHAR</literal>,
  <literal>gtk.WRAP_WORD</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"language"</entry>
	      <entry>Read</entry>
	      <entry>The <classname>pango.Language</classname> object
describing the text language</entry>
	    </row>

	    <row valign="top">
	      <entry>"invisible"</entry>
	      <entry>Read</entry>
	      <entry>If <literal>True</literal> the text is hidden (Not
implemented in PyGTK2)</entry>
	    </row>

	    <row valign="top">
	      <entry>"bg_full_height"</entry>
	      <entry>Read</entry>
	      <entry>If <literal>True</literal> the background is fit to the
full line height</entry>
	    </row>

	    <row valign="top">
	      <entry>"editable"</entry>
	      <entry>Read</entry>
	      <entry>If <literal>True</literal> the text is editable</entry>
	    </row>

	    <row valign="top">
	      <entry>"realized"</entry>
	      <entry>Read</entry>
	      <entry>If <literal>True</literal> the text has been
realized</entry>
	    </row>

	    <row valign="top">
	      <entry>"pad1"</entry>
	      <entry>Read</entry>
	      <entry></entry>
	    </row>

	    <row valign="top">
	      <entry>"pad2"</entry>
	      <entry>Read</entry>
	      <entry></entry>
	    </row>

	    <row valign="top">
	      <entry>"pad3"</entry>
	      <entry>Read</entry>
	      <entry></entry>
	    </row>

	    <row valign="top">
	      <entry>"pad4"</entry>
	      <entry>Read</entry>
	      <entry></entry>
	    </row>

	</tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object holds a set of attributes that describe the properties of a section
of text. A <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object is usually obtained by calling either of the <link
linkend="method-gtktextiter--get-attributes"><methodname>gtk.TextIter.get_attributes</methodname>()</link> 
or <link
linkend="method-gtktextview--get-default-attributes"><methodname>gtk.TextView.get_default_attributes</methodname>()</link> 
methods to retrieve the attributes in effect.</para>

    <para>A <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object created with <link
linkend="constructor-gtktextattributes">gtk.TextAttributes</link>() cannot
be applied within PyGTK because there is no way to set the attributes.
Likewise, the <link
linkend="method-gtktextattributes--copy"><methodname>copy</methodname>()</link> 
and <link
linkend="method-gtktextattributes--copy-values"><methodname>copy_values</methodname>()</link> 
methods can create a new copy or copy the attributes but there are no
methods in PyGTK that take a <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object as an argument. The most effective way to use a <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object is to read its attributes and use them to set the properties of a
<link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>.</para>

  </refsect1>

  <refsect1 id="constructor-gtktextattributes">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.TextAttributes</methodname>
	<methodparam></methodparam>  </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link></simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object, that contains a set of attributes of some text.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

  <refsect2 id="method-gtktextattributes--copy">
      <title>gtk.TextAttributes.copy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a copy of the <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy</methodname>() method copies the text
attributes and returns a new <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object.</para>

    </refsect2>

    <refsect2 id="method-gtktextattributes--copy-values">
      <title>gtk.TextAttributes.copy_values</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy_values</methodname>
	  <methodparam><parameter
			 role="keyword">dest</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">dest</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
whose attributes will be set</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy_values</methodname>() method copies the
values from the <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object to <parameter>dest</parameter> so that <parameter>dest</parameter>
has the same values. Frees existing values in
<parameter>dest</parameter>.</para>

      </refsect2>

  </refsect1>

</refentry>
