1
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="id2793650"></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>):
2
content.</p></div><div class="refsect1" lang="en"><a name="id2994354"></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="id2763323"></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" 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="id2964027"></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>