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 62 63 64 65 66 67 68 69 70 71 72 73
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.CellRendererText</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.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="previous" href="class-gtkcellrendererprogress.html" title="gtk.CellRendererProgress"><link rel="next" href="class-gtkcellrenderertoggle.html" title="gtk.CellRendererToggle"></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.CellRendererText</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkcellrendererprogress.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkcellrenderertoggle.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkcellrenderertext"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.CellRendererText</h2><p>gtk.CellRendererText — an object that renders text into a <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a>
cell</p></div><div class="refsect1" lang="en"><a name="id3277729"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.CellRendererText</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkcellrenderer.html" title="gtk.CellRenderer">gtk.CellRenderer</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkcellrenderertext.html#constructor-gtkcellrenderertext" title="Constructor">gtk.CellRendererText</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcellrenderertext.html#method-gtkcellrenderertext--set-fixed-height-from-font" title="gtk.CellRendererText.set_fixed_height_from_font">set_fixed_height_from_font</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>number_of_rows</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3304946"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkcellrenderer.html" title="gtk.CellRenderer">gtk.CellRenderer</a>
+-- <a href="class-gtkcellrenderertext.html" title="gtk.CellRendererText">gtk.CellRendererText</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3263372"></a><h2>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">"attributes"</td><td valign="top">Read/Write</td><td valign="top">A list of style attributes to apply to the text of the
renderer.</td></tr><tr valign="top"><td valign="top">"background"</td><td valign="top">Write</td><td valign="top">Background color as a string. Default:
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"background-gdk"</td><td valign="top">Read/Write</td><td valign="top">Background color as a gtk.gdk.Color</td></tr><tr valign="top"><td valign="top">"background-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the background
color. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"editable"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> the text can be modified by the
user. GTK+ 2.4 and above. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"editable-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the text
editability. GTK+ 2.4 and above. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"ellipsize"</td><td valign="top">Read/Write</td><td valign="top">The preferred place to ellipsize the string, if the cell
renderer does not have enough room to display the entire string, if at all.
GTK+ 2.6 and above. Default: <tt class="literal">pango.ELLIPSIZE_NONE</tt></td></tr><tr valign="top"><td valign="top">"ellipsize-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the text
editability. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"family"</td><td valign="top">Read/Write</td><td valign="top">Name of the font family, e.g. Sans, Helvetica, Times,
Monospace. Default: <tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"family-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the font
family. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"font"</td><td valign="top">Read/Write</td><td valign="top">Font description as a string. Default:
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"font-desc"</td><td valign="top">Read/Write</td><td valign="top">Font description as a <a href="class-pangofontdescription.html" title="pango.FontDescription"><tt class="classname">pango.FontDescription</tt></a></td></tr><tr valign="top"><td valign="top">"foreground"</td><td valign="top">Write</td><td valign="top">Foreground color as a string. Default:
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"foreground-gdk"</td><td valign="top">Read/Write</td><td valign="top">Foreground color as a <a href="class-gdkcolor.html" title="gtk.gdk.Color"><tt class="classname">gtk.gdk.Color</tt></a></td></tr><tr valign="top"><td valign="top">"foreground-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the foreground
color. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"language"</td><td valign="top">Read/Write</td><td valign="top">The language this text is in, as an ISO code. Pango can use
this as a hint when rendering the text. If you don't understand this parameter,
you probably don't need it. GTK+ 2.4 and above. Default:
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"language-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the
language used to render the text. GTK+ 2.4 and above. Default:
<tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"markup"</td><td valign="top">Write</td><td valign="top">Marked up text to render. Default:
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"rise"</td><td valign="top">Read/Write</td><td valign="top">Offset of text above the baseline (below the baseline if
rise is negative). Default: 0</td></tr><tr valign="top"><td valign="top">"rise-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the
rise. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"scale"</td><td valign="top">Read/Write</td><td valign="top">Font scaling factor. Allowed values >= 0.
Default: 1</td></tr><tr valign="top"><td valign="top">"scale-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag scales the font.
Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"single-paragraph-mode"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt>, keep all text in a single
paragraph. GTK+ 2.4 and above. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"size"</td><td valign="top">Read/Write</td><td valign="top">Font size. Allowed values >= 0. Default: 0</td></tr><tr valign="top"><td valign="top">"size-points"</td><td valign="top">Read/Write</td><td valign="top">Font size in points. Allowed values >= 0.
Default: 0</td></tr><tr valign="top"><td valign="top">"size-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the font
size. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"stretch"</td><td valign="top">Read/Write</td><td valign="top">Font stretch. Default:
<tt class="literal">pango.STRETCH_NORMAL</tt></td></tr><tr valign="top"><td valign="top">"stretch-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the font
stretch. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"strikethrough"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> strike through the text.
Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"strikethrough-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the
strikethrough. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"style"</td><td valign="top">Read/Write</td><td valign="top">Font style. Default:
<tt class="literal">pango.STYLE_NORMAL</tt></td></tr><tr valign="top"><td valign="top">"style-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the font
style. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"text"</td><td valign="top">Read/Write</td><td valign="top">Text to render. Default: <tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"underline"</td><td valign="top">Read/Write</td><td valign="top">Style of underline for this text.
Default: <tt class="literal">pango.UNDERLINE_NONE</tt></td></tr><tr valign="top"><td valign="top">"underline-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the text
underlining. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"variant"</td><td valign="top">Read/Write</td><td valign="top">Font variant. Default:
<tt class="literal">pango.VARIANT_NORMAL</tt></td></tr><tr valign="top"><td valign="top">"variant-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the font
variant. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"weight"</td><td valign="top">Read/Write</td><td valign="top">Font weight. Allowed values >= 0. Default value:
400</td></tr><tr valign="top"><td valign="top">"weight-set"</td><td valign="top">Read/Write</td><td valign="top">If <tt class="literal">TRUE</tt> this tag affects the font
weight. Default: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"width-chars"</td><td valign="top">Read/Write</td><td valign="top">The desired width of the cell, in characters. If this
property is set to -1, the width will be calculated automatically,
otherwise the cell will request either 3 characters or the property
value, whichever is greater. GTK+ 2.6 and above.
Allowed values >= -1. Default value: -1</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3288603"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtkcellrenderertext.html#signal-gtkcellrenderertext--edited" title='The "edited" gtk.CellRendererText Signal'>edited</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>cellrenderertext</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>path</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>new_text</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3304510"></a><h2>Description</h2><p>The <a href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><tt class="classname">gtk.CellRendererText</tt></a>
manages the rendering of text into a <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a>
cell.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkcellrenderertext"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.CellRendererText</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the new cell renderer</td></tr></tbody></table><p>Creates a new <a href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><tt class="classname">gtk.CellRendererText</tt></a>.
The way that text is drawn is changed using object properties. The object
properties can be set globally (with <a href="class-gobject.html#method-gobject--set-property" title="gobject.GObject.set_property"><tt class="methodname">set_property</tt>()</a>).
Also, with <a href="class-gtktreeviewcolumn.html" title="gtk.TreeViewColumn"><tt class="classname">gtk.TreeViewColumn</tt></a>,
you can bind a property to a value in a <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a>.
For example, you can bind the "text" property on the cell renderer to a
string value in the model, thus rendering a different string in each row of
the <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a>.</p></div><div class="refsect1" lang="en"><a name="id3327400"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkcellrenderertext--set-fixed-height-from-font"></a><h3>gtk.CellRendererText.set_fixed_height_from_font</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_fixed_height_from_font</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>number_of_rows</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>number_of_rows</tt></b>:</span></td><td>Number of rows of text each cell renderer is
allocated, or -1</td></tr></tbody></table><p>The <tt class="methodname">set_fixed_height_from_font</tt>() sets
the height of a renderer to explicitly be determined by the "font" and
"ypad" properties set on it. This method must be called each time these
properties are changed to affect the height. This function is inflexible,
and should really only be used if calculating the size of a cell is too slow
(i.e. a massive number of cells displayed). If
<i class="parameter"><tt>number_of_rows</tt></i> is -1, then the fixed height is unset,
and the height is determined by the properties again.</p></div></div><div class="refsect1" lang="en"><a name="id3308266"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkcellrenderertext--edited"></a><h3>The "edited" gtk.CellRendererText Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>cellrenderertext</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>path</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>new_text</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>cellrenderertext</tt></i>:</span></td><td>the cellrenderertext that received the
"edited" signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>path</tt></i>:</span></td><td>the path string of the
cellrenderertext</td></tr><tr><td><span class="term"><i class="parameter"><tt>new_text</tt></i>:</span></td><td>the new text of the
cellrenderertext</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "edited" signal is emitted when the text in the cell has
been edited.</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-gtkcellrendererprogress.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-gtkcellrenderertoggle.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.CellRendererProgress</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.CellRendererToggle</td></tr></table></div></body></html>
|