~ubuntu-branches/ubuntu/natty/pygtk/natty-proposed

« back to all changes in this revision

Viewing changes to docs/html/class-gtktexttag.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-01-07 11:08:47 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107110847-f5av7e1ttudh7ra6
Tags: 2.17.0-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.TextTag</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="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtktextmark.html" title="gtk.TextMark"><link rel="next" href="class-gtktexttagtable.html" title="gtk.TextTagTable"></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.TextTag</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtktextmark.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtktexttagtable.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtktexttag"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.TextTag</h2><p>gtk.TextTag — an object used to apply attributes to text in a <a class="link" href="class-gtktextbuffer.html" title="gtk.TextBuffer"><code class="classname">gtk.TextBuffer</code></a></p></div><div class="refsect1" lang="en"><a name="id3746538"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.TextTag</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
2
 
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gtktexttag.html#constructor-gtktexttag" title="Constructor">gtk.TextTag</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtktexttag.html#method-gtktexttag--get-priority" title="gtk.TextTag.get_priority">get_priority</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtktexttag.html#method-gtktexttag--set-priority" title="gtk.TextTag.set_priority">set_priority</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>priority</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtktexttag.html#method-gtktexttag--event" title="gtk.TextTag.event">event</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>event_object</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>event</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3746701"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.TextTag</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="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtktextmark.html" title="gtk.TextMark"><link rel="next" href="class-gtktexttagtable.html" title="gtk.TextTagTable"></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.TextTag</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtktextmark.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtktexttagtable.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.TextTag"><a name="class-gtktexttag"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.TextTag</h2><p>gtk.TextTag — an object used to apply attributes to text in a <a class="link" href="class-gtktextbuffer.html" title="gtk.TextBuffer"><code class="classname">gtk.TextBuffer</code></a></p></div><div class="refsect1" title="Synopsis"><a name="id4056563"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.TextTag</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
 
2
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gtktexttag.html#constructor-gtktexttag" title="Constructor">gtk.TextTag</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtktexttag.html#method-gtktexttag--get-priority" title="gtk.TextTag.get_priority">get_priority</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtktexttag.html#method-gtktexttag--set-priority" title="gtk.TextTag.set_priority">set_priority</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>priority</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtktexttag.html#method-gtktexttag--event" title="gtk.TextTag.event">event</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>event_object</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>event</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id4056726"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
3
3
  +-- <a class="link" href="class-gtktexttag.html" title="gtk.TextTag">gtk.TextTag</a>
4
 
</pre></div><div class="refsect1" lang="en"><a name="properties-gtktexttag"></a><h2>gtk.TextTag Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"accumulative-margin"</td><td valign="top">Read-Write</td><td valign="top">Whether the margins accumulate or override each other. When set to
 
4
</pre></div><div class="refsect1" title="gtk.TextTag Properties"><a name="properties-gtktexttag"></a><h2>gtk.TextTag Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"accumulative-margin"</td><td valign="top">Read-Write</td><td valign="top">Whether the margins accumulate or override each other. When set to
5
5
          <code class="literal">True</code> the margins of this tag are added to the margins
6
6
          of any other non-accumulative margins present. When set to
7
7
          <code class="literal">False</code> the margins override one another (the default).
91
91
weight</td></tr><tr valign="top"><td valign="top">"wrap-mode"</td><td valign="top">Read-Write</td><td valign="top">The wrap mode of the text:
92
92
<code class="literal">gtk.WRAP_NONE</code>, <code class="literal">gtk.WRAP_CHAR</code> or
93
93
<code class="literal">gtk.WRAP_WORD</code></td></tr><tr valign="top"><td valign="top">"wrap-mode-set"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, this tag affects line wrap
94
 
mode</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtktexttag"></a><h2>gtk.TextTag 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-gtktexttag.html#signal-gtktexttag--event" title='The "event" gtk.TextTag Signal'>event</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</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>widget</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>event</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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="id3748560"></a><h2>Description</h2><p>A <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> object
 
94
mode</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.TextTag Signal Prototypes"><a name="signal-prototypes-gtktexttag"></a><h2>gtk.TextTag 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-gtktexttag.html#signal-gtktexttag--event" title='The "event" gtk.TextTag Signal'>event</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</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>widget</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>event</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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="id4058585"></a><h2>Description</h2><p>A <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> object
95
95
holds attributes that can be applied to a range of text in a <a class="link" href="class-gtktextbuffer.html" title="gtk.TextBuffer"><code class="classname">gtk.TextBuffer</code></a>.
96
96
A texttag can be associated with more than one <a class="link" href="class-gtktextbuffer.html" title="gtk.TextBuffer"><code class="classname">gtk.TextBuffer</code></a>
97
97
by adding it to the <a class="link" href="class-gtktexttagtable.html" title="gtk.TextTagTable"><code class="classname">gtk.TextTagTable</code></a> 
103
103
the attribute property is set by this texttag. Therefore before retrieving
104
104
an attribute value from a texttag you have to check if the associated
105
105
boolean property of the attribute property is
106
 
<code class="literal">True</code>.</p></div><div class="refsect1" lang="en"><a name="constructor-gtktexttag"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.TextTag</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</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>name</code></strong> :</span></p></td><td>tag name, or <code class="literal">None</code> if the
 
106
<code class="literal">True</code>.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtktexttag"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.TextTag</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</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>name</code></strong> :</span></p></td><td>tag name, or <code class="literal">None</code> if the
107
107
texttag is anonymous</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a></td></tr></tbody></table><p>Creates a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> with
108
108
the name specified by <em class="parameter"><code>name</code></em>. If
109
109
<em class="parameter"><code>name</code></em> is <code class="literal">None</code> the texttag will be
110
110
anonymous. The texttag attributes are configured using the <PYGTKDOCLINK HREF="method-gobject--set-property"><code class="methodname">GObject.set_property</code>()</PYGTKDOCLINK> 
111
 
method.</p></div><div class="refsect1" lang="en"><a name="id3748772"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtktexttag--get-priority"></a><h3>gtk.TextTag.get_priority</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_priority</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 texttag's priority.</td></tr></tbody></table><p>The get_priority() method returns the priority or the
112
 
texttag.</p></div><div class="refsect2" lang="en"><a name="method-gtktexttag--set-priority"></a><h3>gtk.TextTag.set_priority</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_priority</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>priority</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>priority</code></strong> :</span></p></td><td>the new priority</td></tr></tbody></table><p>The <code class="methodname">set_priority</code>() method sets the
 
111
method.</p></div><div class="refsect1" title="Methods"><a name="id4058798"></a><h2>Methods</h2><div class="refsect2" title="gtk.TextTag.get_priority"><a name="method-gtktexttag--get-priority"></a><h3>gtk.TextTag.get_priority</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_priority</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 texttag's priority.</td></tr></tbody></table><p>The get_priority() method returns the priority or the
 
112
texttag.</p></div><div class="refsect2" title="gtk.TextTag.set_priority"><a name="method-gtktexttag--set-priority"></a><h3>gtk.TextTag.set_priority</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_priority</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>priority</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>priority</code></strong> :</span></p></td><td>the new priority</td></tr></tbody></table><p>The <code class="methodname">set_priority</code>() method sets the
113
113
priority of a <a class="link" href="class-gtktexttag.html" title="gtk.TextTag"><code class="classname">gtk.TextTag</code></a> to the
114
114
value specified by <em class="parameter"><code>priority</code></em>. Valid priorities start
115
115
at 0 and go to one less than the value returned by the <a class="link" href="class-gtktexttagtable.html#method-gtktexttagtable--get-size" title="gtk.TextTagTable.get_size"><code class="methodname">gtk.TextTagTable.get_size</code>()</a> 
121
121
it will be assigned the highest priority in the table by default; so
122
122
normally the precedence of a set of texttags is the order in which they were
123
123
added to the table, or created with the <a class="link" href="class-gtktextbuffer.html#method-gtktextbuffer--create-tag" title="gtk.TextBuffer.create_tag"><code class="methodname">gtk.TextBuffer.create_tag</code>()</a> 
124
 
method, that adds the texttag to the buffer's table automatically.</p></div><div class="refsect2" lang="en"><a name="method-gtktexttag--event"></a><h3>gtk.TextTag.event</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">event</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>event_object</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>event</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</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>event_object</code></strong> :</span></p></td><td>the object that received the event, such as a
 
124
method, that adds the texttag to the buffer's table automatically.</p></div><div class="refsect2" title="gtk.TextTag.event"><a name="method-gtktexttag--event"></a><h3>gtk.TextTag.event</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">event</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>event_object</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>event</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</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>event_object</code></strong> :</span></p></td><td>the object that received the event, such as a
125
125
widget</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>event</code></strong> :</span></p></td><td>the event</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>iter</code></strong> :</span></p></td><td>the location where the event was
126
126
received</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the result of signal emission (whether the
127
127
event was handled)</td></tr></tbody></table><p>The <code class="methodname">event</code>() method emits the "event"
129
129
widget specified by <em class="parameter"><code>event_object</code></em> with the event
130
130
specified by <em class="parameter"><code>event</code></em> at the textbuffer location
131
131
specified by <em class="parameter"><code>iter</code></em>. This method returns
132
 
<code class="literal">True</code> if the event was handled.</p></div></div><div class="refsect1" lang="en"><a name="id3749141"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtktexttag--event"></a><h3>The "event" gtk.TextTag Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</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>widget</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>event</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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>texttag</code></em> :</span></p></td><td>the texttag that received the
 
132
<code class="literal">True</code> if the event was handled.</p></div></div><div class="refsect1" title="Signals"><a name="id4059167"></a><h2>Signals</h2><div class="refsect2" title='The "event" gtk.TextTag Signal'><a name="signal-gtktexttag--event"></a><h3>The "event" gtk.TextTag Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</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>widget</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>event</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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>texttag</code></em> :</span></p></td><td>the texttag that received the
133
133
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td><td>the widget that received
134
134
<em class="parameter"><code>event</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td><td>the event</td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td>the <a class="link" href="class-gtktextiter.html" title="gtk.TextIter"><code class="classname">gtk.TextIter</code></a>
135
135
pointing to the location where the event was received</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