1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>atk.Text</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="atk-class-reference.html" title="The atk Class Reference"><link rel="prev" href="class-atktable.html" title="atk.Table"><link rel="next" href="class-atkvalue.html" title="atk.Value"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">atk.Text</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-atktable.html">Prev</a> </td><th width="60%" align="center">The atk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-atkvalue.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-atktext"></a><div class="titlepage"></div><div class="refnamediv"><h2>atk.Text</h2><p>atk.Text — the ATK interface implemented by components with text
2
content.</p></div><div class="refsect1" lang="en"><a name="id2809453"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">atk.Text</span></span>(<span class="ooclass"><span class="classname">gobject.GInterface</span></span>):
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>atk.Text</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="atk-class-reference.html" title="The atk Class Reference"><link rel="prev" href="class-atktable.html" title="atk.Table"><link rel="next" href="class-atkvalue.html" title="atk.Value"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">atk.Text</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-atktable.html">Prev</a> </td><th width="60%" align="center">The atk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-atkvalue.html">Next</a></td></tr></table><hr></div><div class="refentry" title="atk.Text"><a name="class-atktext"></a><div class="titlepage"></div><div class="refnamediv"><h2>atk.Text</h2><p>atk.Text — the ATK interface implemented by components with text
2
content.</p></div><div class="refsect1" title="Synopsis"><a name="id3154700"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">atk.Text</span></span>(<span class="ooclass"><span class="classname">gobject.GInterface</span></span>):
3
3
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-text" title="atk.Text.get_text">get_text</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-character-at-offset" title="atk.Text.get_character_at_offset">get_character_at_offset</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-text-after-offset" title="atk.Text.get_text_after_offset">get_text_after_offset</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>boundary_type</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-text-at-offset" title="atk.Text.get_text_at_offset">get_text_at_offset</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>boundary_type</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-text-before-offset" title="atk.Text.get_text_before_offset">get_text_before_offset</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>boundary_type</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-caret-offset" title="atk.Text.get_caret_offset">get_caret_offset</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-character-extents" title="atk.Text.get_character_extents">get_character_extents</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coords</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-run-attributes" title="atk.Text.get_run_attributes">get_run_attributes</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-default-attributes" title="atk.Text.get_default_attributes">get_default_attributes</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-character-count" title="atk.Text.get_character_count">get_character_count</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-offset-at-point" title="atk.Text.get_offset_at_point">get_offset_at_point</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coords</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-n-selections" title="atk.Text.get_n_selections">get_n_selections</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-selection" title="atk.Text.get_selection">get_selection</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>selection_num</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--add-selection" title="atk.Text.add_selection">add_selection</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--remove-selection" title="atk.Text.remove_selection">remove_selection</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>selection_num</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--set-selection" title="atk.Text.set_selection">set_selection</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>selection_num</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--set-caret-offset" title="atk.Text.set_caret_offset">set_caret_offset</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-range-extents" title="atk.Text.get_range_extents">get_range_extents</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coord_type</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#method-atktext--get-bounded-ranges" title="atk.Text.get_bounded_ranges">get_bounded_ranges</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>rect</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coord_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x_clip_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y_clip_type</code></strong></span></span>)</code><br></pre></td></tr></table><pre class="programlisting">
4
4
<span class="bold"><strong>Functions</strong></span>
6
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-get-name" title="atk.text_attribute_get_name">atk.text_attribute_get_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-get-value" title="atk.text_attribute_get_value">atk.text_attribute_get_value</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-register" title="atk.text_attribute_register">atk.text_attribute_register</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-for-name" title="atk.text_attribute_for_name">atk.text_attribute_for_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre></div><div class="refsect1" lang="en"><a name="signal-prototypes-atktext"></a><h2>atk.Text Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-attributes-changed" title='The "text-attributes-changed" atk.Text Signal'>text-attributes-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-caret-moved" title='The "text-caret-moved" atk.Text Signal'>text-caret-moved</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-changed" title='The "text-changed" atk.Text Signal'>text-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>length</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-selection-changed" title='The "text-selection-changed" atk.Text Signal'>text-selection-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id2809198"></a><h2>Description</h2><p><a class="link" href="class-atktext.html" title="atk.Text"><code class="classname">atk.Text</code></a> should be
6
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-get-name" title="atk.text_attribute_get_name">atk.text_attribute_get_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-get-value" title="atk.text_attribute_get_value">atk.text_attribute_get_value</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-register" title="atk.text_attribute_register">atk.text_attribute_register</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-atktext.html#function-atk--text-attribute-for-name" title="atk.text_attribute_for_name">atk.text_attribute_for_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre></div><div class="refsect1" title="atk.Text Signal Prototypes"><a name="signal-prototypes-atktext"></a><h2>atk.Text Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-attributes-changed" title='The "text-attributes-changed" atk.Text Signal'>text-attributes-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-caret-moved" title='The "text-caret-moved" atk.Text Signal'>text-caret-moved</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-changed" title='The "text-changed" atk.Text Signal'>text-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>length</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-atktext.html#signal-atktext--text-selection-changed" title='The "text-selection-changed" atk.Text Signal'>text-selection-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="id3115970"></a><h2>Description</h2><p><a class="link" href="class-atktext.html" title="atk.Text"><code class="classname">atk.Text</code></a> should be
7
7
implemented by <a class="link" href="class-atkobject.html" title="atk.Object"><code class="classname">atk.Object</code></a>
8
8
objects on behalf of widgets that have text content which is either
9
9
attributed or otherwise non-trivial. <a class="link" href="class-atkobject.html" title="atk.Object"><code class="classname">atk.Object</code></a>
21
21
the text strings are exposed as UTF-8, and are therefore potentially
22
22
multi-byte, and caret-to-byte offset mapping makes no assumptions about
23
23
the character length; also bounding box glyph-to-offset mapping may be
24
complex for languages which use ligatures.</p></div><div class="refsect1" lang="en"><a name="id2780231"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-atktext--get-text"></a><h3>atk.Text.get_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>start position</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>end_offset</code></strong> :</span></p></td><td>end position</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the text from
24
complex for languages which use ligatures.</p></div><div class="refsect1" title="Methods"><a name="id3111160"></a><h2>Methods</h2><div class="refsect2" title="atk.Text.get_text"><a name="method-atktext--get-text"></a><h3>atk.Text.get_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>start position</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>end_offset</code></strong> :</span></p></td><td>end position</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the text from
25
25
<em class="parameter"><code>start_offset</code></em> up to, but not including
26
<em class="parameter"><code>end_offset</code></em>.</td></tr></tbody></table><p>Gets the specified text.</p></div><div class="refsect2" lang="en"><a name="method-atktext--get-character-at-offset"></a><h3>atk.Text.get_character_at_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_character_at_offset</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>position</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the character at
27
<em class="parameter"><code>offset</code></em>.</td></tr></tbody></table><p>Gets the specified text.</p></div><div class="refsect2" lang="en"><a name="method-atktext--get-text-after-offset"></a><h3>atk.Text.get_text_after_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text_after_offset</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>boundary_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>position</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>boundary_type</code></strong> :</span></p></td><td>one of the <a class="xref" href="atk-constants.html#atk-text-boundary-constants" title="Atk Text Boundary Constants">Atk Text Boundary Constants</a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 3-tuple containing the text after
26
<em class="parameter"><code>end_offset</code></em>.</td></tr></tbody></table><p>Gets the specified text.</p></div><div class="refsect2" title="atk.Text.get_character_at_offset"><a name="method-atktext--get-character-at-offset"></a><h3>atk.Text.get_character_at_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_character_at_offset</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>position</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the character at
27
<em class="parameter"><code>offset</code></em>.</td></tr></tbody></table><p>Gets the specified text.</p></div><div class="refsect2" title="atk.Text.get_text_after_offset"><a name="method-atktext--get-text-after-offset"></a><h3>atk.Text.get_text_after_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text_after_offset</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>boundary_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>position</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>boundary_type</code></strong> :</span></p></td><td>one of the <a class="xref" href="atk-constants.html#atk-text-boundary-constants" title="Atk Text Boundary Constants">Atk Text Boundary Constants</a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 3-tuple containing the text after
28
28
<em class="parameter"><code>offset</code></em> bounded by the specified
29
29
<em class="parameter"><code>boundary_type</code></em>, the start offset of the
30
30
returned string and the offset of the first character after the
118
118
the line start ar or before the offset.</p><p>If the <em class="parameter"><code>boundary_type</code></em> is
119
119
<code class="literal">atk.TEXT_BOUNDARY_LINE_END</code> the returned string is
120
120
from the line end before the line end before the offset to the line
121
end before the offset.</p></div><div class="refsect2" lang="en"><a name="method-atktext--get-caret-offset"></a><h3>atk.Text.get_caret_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_caret_offset</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the offset position of the caret
122
(cursor).</td></tr></tbody></table><p>Gets the offset position of the caret (cursor).</p></div><div class="refsect2" lang="en"><a name="method-atktext--get-character-extents"></a><h3>atk.Text.get_character_extents</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_character_extents</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coords</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>The offset of the text character for which
121
end before the offset.</p></div><div class="refsect2" title="atk.Text.get_caret_offset"><a name="method-atktext--get-caret-offset"></a><h3>atk.Text.get_caret_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_caret_offset</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the offset position of the caret
122
(cursor).</td></tr></tbody></table><p>Gets the offset position of the caret (cursor).</p></div><div class="refsect2" title="atk.Text.get_character_extents"><a name="method-atktext--get-character-extents"></a><h3>atk.Text.get_character_extents</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_character_extents</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coords</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>The offset of the text character for which
123
123
bounding information is required.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>coords</code></strong> :</span></p></td><td>specify whether coordinates are relative to the
124
124
screen or widget window - one of the <a class="xref" href="atk-constants.html#atk-coord-type-constants" title="Atk Coord Type Constants">Atk Coord Type Constants</a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 4-tuple containing the x, y position and
125
125
width and height of the bounding box.</td></tr></tbody></table><p>Get the bounding box containing the glyph representing the
126
character at a particular text offset.</p></div><div class="refsect2" lang="en"><a name="method-atktext--get-run-attributes"></a><h3>atk.Text.get_run_attributes</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_run_attributes</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>the offset at which to get the attributes</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>the address to put </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>end_offset</code></strong> :</span></p></td><td>the address to put </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 3-tuple containing an attribute set tuple,
126
character at a particular text offset.</p></div><div class="refsect2" title="atk.Text.get_run_attributes"><a name="method-atktext--get-run-attributes"></a><h3>atk.Text.get_run_attributes</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_run_attributes</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>the offset at which to get the attributes</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>the address to put </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>end_offset</code></strong> :</span></p></td><td>the address to put </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 3-tuple containing an attribute set tuple,
127
127
the start offset of the range and the end offset of the range. The
128
128
attribute set tuple contains a 2-tuple of (name, value) strings
129
129
for each attribute explicitly set at
161
161
numbering.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 3-tuple containing the selected text, the
162
162
start position of the selected region and the end position of
163
163
(e.g. offset immediately past) the selected
164
region.</td></tr></tbody></table><p>Gets the text from the specified selection.</p></div><div class="refsect2" lang="en"><a name="method-atktext--add-selection"></a><h3>atk.Text.add_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_selection</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>the start position of the selected
164
region.</td></tr></tbody></table><p>Gets the text from the specified selection.</p></div><div class="refsect2" title="atk.Text.add_selection"><a name="method-atktext--add-selection"></a><h3>atk.Text.add_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_selection</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>the start position of the selected
165
165
region</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>end_offset</code></strong> :</span></p></td><td>the offset of the first character after the
166
166
selected region.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if success,
167
<code class="literal">False</code> otherwise</td></tr></tbody></table><p>Adds a selection bounded by the specified offsets.</p></div><div class="refsect2" lang="en"><a name="method-atktext--remove-selection"></a><h3>atk.Text.remove_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_selection</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>selection_num</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>selection_num</code></strong> :</span></p></td><td>The selection number. The selected regions are
167
<code class="literal">False</code> otherwise</td></tr></tbody></table><p>Adds a selection bounded by the specified offsets.</p></div><div class="refsect2" title="atk.Text.remove_selection"><a name="method-atktext--remove-selection"></a><h3>atk.Text.remove_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_selection</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>selection_num</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>selection_num</code></strong> :</span></p></td><td>The selection number. The selected regions are
168
168
assigned numbers that correspond to how far the region is from the
169
169
start of the text. The selected region closest to the beginning
170
170
of the text region is assigned the number 0, etc. Note that
171
171
adding, moving or deleting a selected region can change the
172
172
numbering.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if success,
173
<code class="literal">False</code> otherwise</td></tr></tbody></table><p>Removes the specified selection.</p></div><div class="refsect2" lang="en"><a name="method-atktext--set-selection"></a><h3>atk.Text.set_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_selection</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>selection_num</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>selection_num</code></strong> :</span></p></td><td>The selection number. The selected regions are
173
<code class="literal">False</code> otherwise</td></tr></tbody></table><p>Removes the specified selection.</p></div><div class="refsect2" title="atk.Text.set_selection"><a name="method-atktext--set-selection"></a><h3>atk.Text.set_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_selection</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>selection_num</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>selection_num</code></strong> :</span></p></td><td>The selection number. The selected regions are
174
174
assigned numbers that correspond to how far the region is from the
175
175
start of the text. The selected region closest to the beginning
176
176
of the text region is assigned the number 0, etc. Note that
179
179
selection</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>end_offset</code></strong> :</span></p></td><td>the new end position of (e.g. offset
180
180
immediately past) the selection</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if success,
181
181
<code class="literal">False</code> otherwise</td></tr></tbody></table><p>Changes the start and end offset of the specified
182
selection.</p></div><div class="refsect2" lang="en"><a name="method-atktext--set-caret-offset"></a><h3>atk.Text.set_caret_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_caret_offset</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>position</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if success,
182
selection.</p></div><div class="refsect2" title="atk.Text.set_caret_offset"><a name="method-atktext--set-caret-offset"></a><h3>atk.Text.set_caret_offset</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_caret_offset</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>offset</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>offset</code></strong> :</span></p></td><td>position</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if success,
183
183
<code class="literal">False</code> otherwise.</td></tr></tbody></table><p>Sets the caret (cursor) position to the specified
184
<em class="parameter"><code>offset</code></em>.</p></div><div class="refsect2" lang="en"><a name="method-atktext--get-range-extents"></a><h3>atk.Text.get_range_extents</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_range_extents</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coord_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>The offset of the first text character for
184
<em class="parameter"><code>offset</code></em>.</p></div><div class="refsect2" title="atk.Text.get_range_extents"><a name="method-atktext--get-range-extents"></a><h3>atk.Text.get_range_extents</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_range_extents</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>start_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>end_offset</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coord_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>start_offset</code></strong> :</span></p></td><td>The offset of the first text character for
185
185
which boundary information is required.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>end_offset</code></strong> :</span></p></td><td>The offset of the text character after the last
186
186
character for which boundary information is
187
187
required.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>coord_type</code></strong> :</span></p></td><td>Specify whether coordinates are relative to the
188
188
screen or widget window - one of the <a class="xref" href="atk-constants.html#atk-coord-type-constants" title="Atk Coord Type Constants">Atk Coord Type Constants</a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-atkrectangle.html" title="atk.Rectangle"><code class="classname">atk.Rectangle</code></a>
189
containing the extents of the range.</td></tr></tbody></table><p>Get the bounding box for text within the specified range.</p></div><div class="refsect2" lang="en"><a name="method-atktext--get-bounded-ranges"></a><h3>atk.Text.get_bounded_ranges</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_bounded_ranges</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>rect</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coord_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x_clip_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y_clip_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>rect</code></strong> :</span></p></td><td>An <a class="link" href="class-atkrectangle.html" title="atk.Rectangle"><code class="classname">atk.Rectangle</code></a>
189
containing the extents of the range.</td></tr></tbody></table><p>Get the bounding box for text within the specified range.</p></div><div class="refsect2" title="atk.Text.get_bounded_ranges"><a name="method-atktext--get-bounded-ranges"></a><h3>atk.Text.get_bounded_ranges</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_bounded_ranges</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>rect</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>coord_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x_clip_type</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y_clip_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>rect</code></strong> :</span></p></td><td>An <a class="link" href="class-atkrectangle.html" title="atk.Rectangle"><code class="classname">atk.Rectangle</code></a>
190
190
giving the dimensions of the bounding box.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>coord_type</code></strong> :</span></p></td><td>Specify whether coordinates are relative to the
191
191
screen or widget window - one of the <a class="xref" href="atk-constants.html#atk-coord-type-constants" title="Atk Coord Type Constants">Atk Coord Type Constants</a>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x_clip_type</code></strong> :</span></p></td><td>Specify the horizontal clip type - one of the
192
192
<a class="xref" href="atk-constants.html#atk-text-clip-type-constants" title="Atk Text Clip Type Constants">Atk Text Clip Type Constants</a>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y_clip_type</code></strong> :</span></p></td><td>Specify the vertical clip type - one of the
193
193
<a class="xref" href="atk-constants.html#atk-text-clip-type-constants" title="Atk Text Clip Type Constants">Atk Text Clip Type Constants</a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of text ranges. The list contains a
194
194
4-tuple for each text range. The 4-tuple contains a <a class="link" href="class-atkrectangle.html" title="atk.Rectangle"><code class="classname">atk.Rectangle</code></a>
195
195
bounding the text range, the start and end offsets of the range
196
and the text in the range.</td></tr></tbody></table><p>Get the ranges of text in the specified bounding box.</p></div></div><div class="refsect1" lang="en"><a name="id2782108"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-atk--text-attribute-get-name"></a><h3>atk.text_attribute_get_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_get_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>attr</code></strong> :</span></p></td><td>a text attribute (one of the <a class="xref" href="atk-constants.html#atk-text-attr-constants" title="Atk Text Attribute Constants">Atk Text Attribute Constants</a>) whose name is
196
and the text in the range.</td></tr></tbody></table><p>Get the ranges of text in the specified bounding box.</p></div></div><div class="refsect1" title="Functions"><a name="id3096260"></a><h2>Functions</h2><div class="refsect2" title="atk.text_attribute_get_name"><a name="function-atk--text-attribute-get-name"></a><h3>atk.text_attribute_get_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_get_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>attr</code></strong> :</span></p></td><td>a text attribute (one of the <a class="xref" href="atk-constants.html#atk-text-attr-constants" title="Atk Text Attribute Constants">Atk Text Attribute Constants</a>) whose name is
197
197
required</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string containing the name</td></tr></tbody></table><p>Gets the name corresponding to
198
<em class="parameter"><code>attr</code></em>.</p></div><div class="refsect2" lang="en"><a name="function-atk--text-attribute-get-value"></a><h3>atk.text_attribute_get_value</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_get_value</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>attr</code></strong> :</span></p></td><td>a text attribute (one of the <a class="xref" href="atk-constants.html#atk-text-attr-constants" title="Atk Text Attribute Constants">Atk Text Attribute Constants</a>) whose name is
198
<em class="parameter"><code>attr</code></em>.</p></div><div class="refsect2" title="atk.text_attribute_get_value"><a name="function-atk--text-attribute-get-value"></a><h3>atk.text_attribute_get_value</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_get_value</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attr</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>attr</code></strong> :</span></p></td><td>a text attribute (one of the <a class="xref" href="atk-constants.html#atk-text-attr-constants" title="Atk Text Attribute Constants">Atk Text Attribute Constants</a>) whose name is
199
199
required</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>index</code></strong> :</span></p></td><td>The index of the required
200
200
value</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string containing the
201
201
value. <code class="literal">None</code> is returned if there are no values
202
202
maintained for the <em class="parameter"><code>attr</code></em>
203
203
value.</td></tr></tbody></table><p>Gets the value for the <em class="parameter"><code>index</code></em> of the text
204
attribute specified by <em class="parameter"><code>attr</code></em>.</p></div><div class="refsect2" lang="en"><a name="function-atk--text-attribute-register"></a><h3>atk.text_attribute_register</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_register</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>a name string</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new one of the <a class="xref" href="atk-constants.html#atk-text-attr-constants" title="Atk Text Attribute Constants">Atk Text Attribute Constants</a> that is associated
204
attribute specified by <em class="parameter"><code>attr</code></em>.</p></div><div class="refsect2" title="atk.text_attribute_register"><a name="function-atk--text-attribute-register"></a><h3>atk.text_attribute_register</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_register</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>a name string</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new one of the <a class="xref" href="atk-constants.html#atk-text-attr-constants" title="Atk Text Attribute Constants">Atk Text Attribute Constants</a> that is associated
205
205
with name</td></tr></tbody></table><p>Associate <em class="parameter"><code>name</code></em> with a new text
206
attribute.</p></div><div class="refsect2" lang="en"><a name="function-atk--text-attribute-for-name"></a><h3>atk.text_attribute_for_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_for_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>a string which is the (non-localized) name of
206
attribute.</p></div><div class="refsect2" title="atk.text_attribute_for_name"><a name="function-atk--text-attribute-for-name"></a><h3>atk.text_attribute_for_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">atk.text_attribute_for_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>a string which is the (non-localized) name of
207
207
an ATK text attribute.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the text attribute (one of the <a class="xref" href="atk-constants.html#atk-text-attr-constants" title="Atk Text Attribute Constants">Atk Text Attribute Constants</a>) corresponding to
208
208
the specified name, or
209
209
<code class="literal">atk.TEXT_ATTRIBUTE_INVALID</code> if no matching text
210
210
attribute is found.</td></tr></tbody></table><p>Get the text attribute type corresponding to a text attribute
211
name specified by <em class="parameter"><code>name</code></em>.</p></div></div><div class="refsect1" lang="en"><a name="id2794196"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-atktext--text-attributes-changed"></a><h3>The "text-attributes-changed" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the
211
name specified by <em class="parameter"><code>name</code></em>.</p></div></div><div class="refsect1" title="Signals"><a name="id3060250"></a><h2>Signals</h2><div class="refsect2" title='The "text-attributes-changed" atk.Text Signal'><a name="signal-atktext--text-attributes-changed"></a><h3>The "text-attributes-changed" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the
212
212
signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
213
213
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
214
214
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>The "text-attributes-changed" signal is emitted when the text
215
215
attributes of the text of an object which implements <a class="link" href="class-atktext.html" title="atk.Text"><code class="classname">atk.Text</code></a>
216
changes.</p></div><div class="refsect2" lang="en"><a name="signal-atktext--text-caret-moved"></a><h3>The "text-caret-moved" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the
216
changes.</p></div><div class="refsect2" title='The "text-caret-moved" atk.Text Signal'><a name="signal-atktext--text-caret-moved"></a><h3>The "text-caret-moved" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the
217
217
signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td><td>The new position of the text
218
218
caret.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
219
219
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
220
220
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>The "text-caret-moved" signal is emitted when the caret position
221
221
of the text of an object which implements <a class="link" href="class-atktext.html" title="atk.Text"><code class="classname">atk.Text</code></a>
222
changes.</p></div><div class="refsect2" lang="en"><a name="signal-atktext--text-changed"></a><h3>The "text-changed" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>length</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td><td>The position of the insertion or deletion.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td><td>The length of text inserted or deleted.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
222
changes.</p></div><div class="refsect2" title='The "text-changed" atk.Text Signal'><a name="signal-atktext--text-changed"></a><h3>The "text-changed" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>position</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>length</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td><td>The position of the insertion or deletion.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td><td>The length of text inserted or deleted.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
223
223
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
224
224
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>The "text-changed" signal is emitted when the text of the object
225
225
which implements the <a class="link" href="class-atktext.html" title="atk.Text"><code class="classname">atk.Text</code></a>
226
226
interface changes, This signal will have a detail which is either
227
227
"insert" or "delete" which identifies whether the text change was an
228
insertion or a deletion</p></div><div class="refsect2" lang="en"><a name="signal-atktext--text-selection-changed"></a><h3>The "text-selection-changed" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
228
insertion or a deletion</p></div><div class="refsect2" title='The "text-selection-changed" atk.Text Signal'><a name="signal-atktext--text-selection-changed"></a><h3>The "text-selection-changed" atk.Text Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>atktext</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>atktext</code></em> :</span></p></td><td>the object which received the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
229
229
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
230
230
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>The "text-selection-changed" signal is emitted when the selected
231
231
text of an object which implements <a class="link" href="class-atktext.html" title="atk.Text"><code class="classname">atk.Text</code></a>