1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.TextTagTable</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtktexttag.html" title="gtk.TextTag"><link rel="next" href="class-gtktextview.html" title="gtk.TextView"></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">gtk.TextTagTable</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtktexttag.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtktextview.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.TextTagTable"><a name="class-gtktexttagtable"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.TextTagTable</h2><p>gtk.TextTagTable — A collection of <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> objects
that can be used together</p></div><div class="refsect1" title="Synopsis"><a name="id3967933"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.TextTagTable</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtktexttagtable.html#constructor-gtktexttagtable" title="Constructor">gtk.TextTagTable</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktexttagtable.html#method-gtktexttagtable--add" title="gtk.TextTagTable.add">add</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktexttagtable.html#method-gtktexttagtable--remove" title="gtk.TextTagTable.remove">remove</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktexttagtable.html#method-gtktexttagtable--lookup" title="gtk.TextTagTable.lookup">lookup</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-gtktexttagtable.html#method-gtktexttagtable--foreach" title="gtk.TextTagTable.foreach">foreach</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>func</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktexttagtable.html#method-gtktexttagtable--get-size" title="gtk.TextTagTable.get_size">get_size</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3968128"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable">gtk.TextTagTable</a>
</pre></div><div class="refsect1" title="gtk.TextTagTable Signal Prototypes"><a name="signal-prototypes-gtktexttagtable"></a><h2>gtk.TextTagTable Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><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-gtktexttagtable.html#signal-gtktexttagtable--tag-added" title='The "tag-added" gtk.TextTagTable Signal'>tag-added</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>texttagtable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>texttag</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-gtktexttagtable.html#signal-gtktexttagtable--tag-changed" title='The "tag-changed" gtk.TextTagTable Signal'>tag-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>texttagtable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>texttag</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>size_changed</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-gtktexttagtable.html#signal-gtktexttagtable--tag-removed" title='The "tag-removed" gtk.TextTagTable Signal'>tag-removed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>texttagtable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>texttag</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="id3968409"></a><h2>Description</h2><p>A <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a>
object holds a set of <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> objects
for use with a <a class="link" href="class-gtktextbuffer.html" title="gtk.TextBuffer"><code class="classname">gtk.TextBuffer</code></a>.
Usually a <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a>
is created automatically when a <a class="link" href="class-gtktextbuffer.html" title="gtk.TextBuffer"><code class="classname">gtk.TextBuffer</code></a>
is created but a standalone <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a>
can be created using the <a class="link" href="class-gtktexttagtable.html#constructor-gtktexttagtable" title="Constructor">gtk.TextTagTable</a>() constructor.
A <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a>
can be passed as an argument to the <a class="link" href="class-gtktextbuffer.html#constructor-gtktextbuffer" title="Constructor">gtk.TextBuffer</a>() constructor to
associate an existing <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a>
rather than creating a new one. This is useful when several textbuffers need
to use the same texttags.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtktexttagtable"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.TextTagTable</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>a new <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a></td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a>.
The table contains no tags by default.</p></div><div class="refsect1" title="Methods"><a name="id3968565"></a><h2>Methods</h2><div class="refsect2" title="gtk.TextTagTable.add"><a name="method-gtktexttagtable--add"></a><h3>gtk.TextTagTable.add</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag</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>tag</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a></td></tr></tbody></table><p>The <code class="methodname">add</code>() method adds a texttag to the
texttagtable. The texttag is assigned the highest priority in the
texttagtable. A <code class="literal">ValueError</code> exception is raised if
<em class="parameter"><code>tag</code></em> is in a texttag table already, or has the same
name as another texttag in the texttagtable.</p></div><div class="refsect2" title="gtk.TextTagTable.remove"><a name="method-gtktexttagtable--remove"></a><h3>gtk.TextTagTable.remove</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag</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>tag</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a></td></tr></tbody></table><p>The <code class="methodname">remove</code>() method removes a texttag
from the texttagtable.</p></div><div class="refsect2" title="gtk.TextTagTable.lookup"><a name="method-gtktexttagtable--lookup"></a><h3>gtk.TextTagTable.lookup</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">lookup</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>the name of a texttag</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The texttag, or <code class="literal">None</code> if none
by that name is in the texttagtable.</td></tr></tbody></table><p>The <code class="methodname">lookup</code>() method looks in the
texttagtable for a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> with
the name specified by <em class="parameter"><code>name</code></em> and returns it if found.
This method returns <code class="literal">None</code> if <em class="parameter"><code>name</code></em>
does not identify a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> in the
texttagtable.</p></div><div class="refsect2" title="gtk.TextTagTable.foreach"><a name="method-gtktexttagtable--foreach"></a><h3>gtk.TextTagTable.foreach</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">foreach</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>func</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span><span class="initializer">=None</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>func</code></strong> :</span></p></td><td>a function to call on each texttag</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>data</code></strong> :</span></p></td><td>user data to pass to
<em class="parameter"><code>func</code></em> or
<code class="literal">None</code></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">foreach</code>() method calls the function
specified by <em class="parameter"><code>func</code></em> on each texttag in the text tag
table passing the user data specified by <em class="parameter"><code>data</code></em>. The
signature of <em class="parameter"><code>func</code></em> is:</p><pre class="programlisting">
def func(texttag, user_data):
</pre><p>where <em class="parameter"><code>texttag</code></em> is a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> in the
text tag table and <em class="parameter"><code>user_data</code></em> is
<em class="parameter"><code>data</code></em>.
Note that the table may not be modified while iterating over it (you can't add/remove tags).</p></div><div class="refsect2" title="gtk.TextTagTable.get_size"><a name="method-gtktexttagtable--get-size"></a><h3>gtk.TextTagTable.get_size</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_size</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 number of texttags in the
texttagtable</td></tr></tbody></table><p>The <code class="methodname">get_size</code>() method returns the size
of the texttagtable (number of texttags).</p></div></div><div class="refsect1" title="Signals"><a name="id3969106"></a><h2>Signals</h2><div class="refsect2" title='The "tag-added" gtk.TextTagTable Signal'><a name="signal-gtktexttagtable--tag-added"></a><h3>The "tag-added" gtk.TextTagTable Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>texttagtable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>texttag</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>texttagtable</code></em> :</span></p></td><td>the texttagtable that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>texttag</code></em> :</span></p></td><td>a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a></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
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
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 "tag-added" signal is emitted when the <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a>
specified by <em class="parameter"><code>texttag</code></em> is added to
<em class="parameter"><code>texttagtable</code></em>.</p></div><div class="refsect2" title='The "tag-changed" gtk.TextTagTable Signal'><a name="signal-gtktexttagtable--tag-changed"></a><h3>The "tag-changed" gtk.TextTagTable Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>texttagtable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>texttag</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>size_changed</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>texttagtable</code></em> :</span></p></td><td>the texttagtable that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>texttag</code></em> :</span></p></td><td>a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>size_changed</code></em> :</span></p></td><td>if <code class="literal">True</code> a
<em class="parameter"><code>texttag</code></em> property has changed that may affect the size
of the text enclosed by the texttag</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
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
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 "tag-changed" signal is emitted when a property of the <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a>
specified by <em class="parameter"><code>texttag</code></em> is changed. If
<em class="parameter"><code>size_changed</code></em> is <code class="literal">True</code> the text
enclosed by <em class="parameter"><code>texttag</code></em> will change size.</p></div><div class="refsect2" title='The "tag-removed" gtk.TextTagTable Signal'><a name="signal-gtktexttagtable--tag-removed"></a><h3>The "tag-removed" gtk.TextTagTable Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>texttagtable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>texttag</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>texttagtable</code></em> :</span></p></td><td>the texttagtable that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>texttag</code></em> :</span></p></td><td>a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a></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
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
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 "tag-removed" signal is emitted when the <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a>
specified by <em class="parameter"><code>texttag</code></em> is removed from
<em class="parameter"><code>texttagtable</code></em></p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtktexttag.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtktextview.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.TextTag </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.TextView</td></tr></table></div></body></html>
|