File: class-gtkcellrenderer.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (124 lines) | stat: -rw-r--r-- 33,857 bytes parent folder | download
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.CellRenderer</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-gtkcelllayout.html" title="gtk.CellLayout"><link rel="next" href="class-gtkcellrenderercombo.html" title="gtk.CellRendererCombo"></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.CellRenderer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkcelllayout.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkcellrenderercombo.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkcellrenderer"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.CellRenderer</h2><p>gtk.CellRenderer &#8212; a base class for objects that render into Treeview
cells</p></div><div class="refsect1" lang="en"><a name="id3219237"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.CellRenderer</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a></span></span>):
<code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--get-size" title="gtk.CellRenderer.get_size">get_size</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render">render</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>window</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>expose_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--activate" title="gtk.CellRenderer.activate">activate</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>event</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--start-editing" title="gtk.CellRenderer.start_editing">start_editing</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>event</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--editing-canceled" title="gtk.CellRenderer.editing_canceled">editing_canceled</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--stop-editing" title="gtk.CellRenderer.stop_editing">stop_editing</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>canceled</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--set-fixed-size" title="gtk.CellRenderer.set_fixed_size">set_fixed_size</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcellrenderer.html#method-gtkcellrenderer--get-fixed-size" title="gtk.CellRenderer.get_fixed_size">get_fixed_size</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3154465"></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>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3198783"></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">"mode"</td><td valign="top">Read/Write</td><td valign="top">The editable mode of the cellrenderer. One of:
<tt class="literal">gtk.CELL_RENDERER_MODE_INERT</tt>,
<tt class="literal">gtk.CELL_RENDERER_MODE_ACTIVATABLE</tt> or
<tt class="literal">gtk.CELL_RENDERER_MODE_EDITABLE</tt></td></tr><tr valign="top"><td valign="top">"visible"</td><td valign="top">Read/Write</td><td valign="top">If TRUE the cell is displayed</td></tr><tr valign="top"><td valign="top">"xalign"</td><td valign="top">Read/Write</td><td valign="top">The fraction of <span class="emphasis"><em>free</em></span> space to the left
of the cell in the range 0.0 to 1.0.</td></tr><tr valign="top"><td valign="top">"yalign"</td><td valign="top">Read/Write</td><td valign="top">The fraction of <span class="emphasis"><em>free</em></span> space above the
cell in the range 0.0 to 1.0.</td></tr><tr valign="top"><td valign="top">"xpad"</td><td valign="top">Read/Write</td><td valign="top">The amount of padding to the left and right of the
cell.</td></tr><tr valign="top"><td valign="top">"ypad"</td><td valign="top">Read/Write</td><td valign="top">The amount of padding above and below cell.</td></tr><tr valign="top"><td valign="top">"width"</td><td valign="top">Read/Write</td><td valign="top">The fixed width of the cell.</td></tr><tr valign="top"><td valign="top">"height"</td><td valign="top">Read/Write</td><td valign="top">The fixed height of the cell.</td></tr><tr valign="top"><td valign="top">"is-expander"</td><td valign="top">Read/Write</td><td valign="top">If TRUE the row has children</td></tr><tr valign="top"><td valign="top">"is-expanded"</td><td valign="top">Read/Write</td><td valign="top">If TRUE the row has children and it is expanded to show the
children.</td></tr><tr valign="top"><td valign="top">"cell-background"</td><td valign="top">Write</td><td valign="top">The background color of the cell as a string.</td></tr><tr valign="top"><td valign="top">"cell-background-gdk"</td><td valign="top">Read/Write</td><td valign="top">The background color of the cell 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">"cell-background-set"</td><td valign="top">Read/Write</td><td valign="top">If TRUE the cell background color is set by this
cellrenderer</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3340579"></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-gtkcellrenderer.html#signal-gtkcellrenderer--editing-canceled" title='The "editing-canceled" gtk.CellRenderer Signal'>editing-canceled</a>"</span></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>cellrenderer</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><tr><td><span class="term">"<a href="class-gtkcellrenderer.html#signal-gtkcellrenderer--editing-started" title='The "editing-started" gtk.CellRenderer Signal'>editing-started</a>"</span></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>cellrenderer</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>editable</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>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="id3327376"></a><h2>Description</h2><p>The <a href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><tt class="classname">gtk.CellRenderer</tt></a>
is a base class for a set of objects used for rendering a cell to a <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>. The
<a href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><tt class="classname">gtk.CellRenderer</tt></a>
provides the common attributes and methods for its subclasses (<a href="class-gtkcellrendererpixbuf.html" title="gtk.CellRendererPixbuf"><tt class="classname">gtk.CellRendererPixbuf</tt></a>,
<a href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><tt class="classname">gtk.CellRendererText</tt></a>
and <a href="class-gtkcellrenderertoggle.html" title="gtk.CellRendererToggle"><tt class="classname">gtk.CellRendererToggle</tt></a>).</p><p>The primary use of a <a href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><tt class="classname">gtk.CellRenderer</tt></a>
    is for drawing a certain graphical elements on a <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>. Typically,
    one cell renderer is used to draw many cells on the screen. To this
    extent, it isn't expected that a CellRenderer keep any permanent state
    around. Instead, any state is set just prior to use using the GObjects
    property system. Then, the cell is measured using the <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--get-size" title="gtk.CellRenderer.get_size"><tt class="methodname">get_size</tt>()</a>
    method. Finally, the cell is rendered in the correct location using the
    <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><tt class="methodname">render</tt>()</a>
    method.</p></div><div class="refsect1" lang="en"><a name="id3143098"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--get-size"></a><h3>gtk.CellRenderer.get_size</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_size</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</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>widget</tt></b>:</span></td><td>the widget the renderer is rendering
to</td></tr><tr><td><span class="term"><b class="parameter"><tt>cell_area</tt></b>:</span></td><td>The area a cell will be allocated, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a tuple containing the xoffset, yoffset, width
and height</td></tr></tbody></table><p>The <tt class="methodname">get_size</tt>() method obtains the width
and height needed to render the cell. These values are returned as part of a
tuple containing the x_offset, y_offset, width and height.
<tt class="methodname">get_size</tt>() is used by view widgets to determine the
appropriate size for the <i class="parameter"><tt>cell_area</tt></i> to be passed to
the <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><tt class="function">gtk.CellRenderer.render()</tt></a> 
method. If <i class="parameter"><tt>cell_area</tt></i> is not <tt class="literal">None</tt>,
the x and y offsets of the cell relative to this location are returned.
Please note that the values set in the returned width and height, as well as
those in x_offset and y_offset are inclusive of the xpad and ypad
properties.</p></div><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--render"></a><h3>gtk.CellRenderer.render</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">render</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>window</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>expose_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</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>window</tt></b>:</span></td><td>a <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>
to draw to</td></tr><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>the widget owning
<i class="parameter"><tt>window</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>background_area</tt></b>:</span></td><td>entire cell area (including tree expanders and
maybe padding on the sides)</td></tr><tr><td><span class="term"><b class="parameter"><tt>cell_area</tt></b>:</span></td><td>area normally rendered by a cell
renderer</td></tr><tr><td><span class="term"><b class="parameter"><tt>expose_area</tt></b>:</span></td><td>area that actually needs
updating</td></tr><tr><td><span class="term"><b class="parameter"><tt>flags</tt></b>:</span></td><td>flags that affect
rendering</td></tr></tbody></table><p>The <tt class="methodname">render</tt>() method invokes the virtual
render function of the <a href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><tt class="classname">gtk.CellRenderer</tt></a>. 
The three passed-in rectangles are areas of <i class="parameter"><tt>window</tt></i>.
Most renderers will draw within <i class="parameter"><tt>cell_area</tt></i>; the
xalign, yalign, xpad, and ypad properties of the <a href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><tt class="classname">gtk.CellRenderer</tt></a> 
should be honored with respect to <i class="parameter"><tt>cell_area</tt></i>.
<i class="parameter"><tt>background_area</tt></i> includes the blank space around the
cell, and also the area containing the tree expander; so the
<i class="parameter"><tt>background_area</tt></i> rectangles for all cells tile to
cover the entire <i class="parameter"><tt>window</tt></i>.
<i class="parameter"><tt>expose_area</tt></i> is a clip rectangle.</p><p>The <i class="parameter"><tt>flags</tt></i> value is one of:
<tt class="literal">gtk.CELL_RENDERER_SELECTED</tt>,
<tt class="literal">gtk.CELL_RENDERER_PRELIT</tt>,
<tt class="literal">gtk.CELL_RENDERER_INSENSITIVE</tt> or
<tt class="literal">gtk.CELL_RENDERER_SORTED</tt></p></div><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--activate"></a><h3>gtk.CellRenderer.activate</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">activate</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>event</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</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>event</tt></b>:</span></td><td>a <a href="class-gdkevent.html" title="gtk.gdk.Event"><tt class="classname">gtk.gdk.Event</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>widget that received the
event</td></tr><tr><td><span class="term"><b class="parameter"><tt>path</tt></b>:</span></td><td>widget-dependent string representation of the
event location; e.g. for <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a>, a
string representation of
<tt class="literal">gtk.TreePath</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>background_area</tt></b>:</span></td><td>background area as passed to <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><tt class="methodname">render</tt>()</a></td></tr><tr><td><span class="term"><b class="parameter"><tt>cell_area</tt></b>:</span></td><td>cell area as passed to <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><tt class="methodname">render</tt>()</a></td></tr><tr><td><span class="term"><b class="parameter"><tt>flags</tt></b>:</span></td><td>render flags</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the event was
consumed/handled</td></tr></tbody></table><p>The <tt class="methodname">activate</tt>() method passes an
activate event to the cell renderer for possible processing.  Some cell
renderers may use events; for example, <a href="class-gtkcellrenderertoggle.html" title="gtk.CellRendererToggle"><tt class="classname">gtk.CellRendererToggle</tt></a> 
toggles when it gets a mouse click.</p><p>The <i class="parameter"><tt>flags</tt></i> value is one of:
<tt class="literal">gtk.CELL_RENDERER_SELECTED</tt>,
<tt class="literal">gtk.CELL_RENDERER_PRELIT</tt>,
<tt class="literal">gtk.CELL_RENDERER_INSENSITIVE</tt> or
<tt class="literal">gtk.CELL_RENDERER_SORTED</tt></p></div><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--start-editing"></a><h3>gtk.CellRenderer.start_editing</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">start_editing</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>event</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>path</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>background_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cell_area</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>flags</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>event</tt></b>:</span></td><td>a <a href="class-gdkevent.html" title="gtk.gdk.Event"><tt class="classname">gtk.gdk.Event</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>the widget that received the
event</td></tr><tr><td><span class="term"><b class="parameter"><tt>path</tt></b>:</span></td><td>a widget-dependent string representation of the
event location; e.g. for <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a>, a
string representation of
<tt class="literal">gtk.TreePath</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>background_area</tt></b>:</span></td><td>background area as passed to <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><tt class="methodname">render</tt>()</a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>cell_area</tt></b>:</span></td><td>cell area as passed to <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><tt class="methodname">render</tt>()</a></td></tr><tr><td><span class="term"><b class="parameter"><tt>flags</tt></b>:</span></td><td>render flags</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>A new <a href="class-gtkcelleditable.html" title="gtk.CellEditable"><tt class="classname">gtk.CellEditable</tt></a>, 
or <tt class="literal">None</tt></td></tr></tbody></table><p>The <tt class="methodname">start_editing</tt>() method initiates
the editing of a cell.</p></div><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--editing-canceled"></a><h3>gtk.CellRenderer.editing_canceled</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">editing_canceled</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><div class="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><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is deprecated in PyGTK 2.6 and above. Use the
<a href="class-gtkcellrenderer.html#method-gtkcellrenderer--stop-editing" title="gtk.CellRenderer.stop_editing"><tt class="methodname">stop_editing</tt>()</a>
method instead.</p></div><p>The <tt class="methodname">editing_canceled</tt>() method causes
the cell renderer to emit the "editing-canceled" signal. This method is for
use only by implementations of cell renderers that need to notify the client
program that an editing process was canceled and the changes were not
committed.</p></div><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--stop-editing"></a><h3>gtk.CellRenderer.stop_editing</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">stop_editing</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>canceled</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>canceled</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> the editing has been
canceled</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">stop_editing</tt>() method informs the
cell renderer that the editing is stopped. If
<i class="parameter"><tt>canceled</tt></i> is <tt class="literal">TRUE</tt>, the cell
renderer will emit the "editing-canceled" signal. This method should be
called by cell renderer implementations in response to the "editing-done"
signal of <a href="class-gtkcelleditable.html" title="gtk.CellEditable"><tt class="classname">gtk.CellEditable</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--set-fixed-size"></a><h3>gtk.CellRenderer.set_fixed_size</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_fixed_size</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</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>width</tt></b>:</span></td><td>the width of the cell renderer, or
-1</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height of the cell renderer, or
-1</td></tr></tbody></table><p>The <tt class="methodname">set_fixed_size</tt>() method sets the
renderer size to the specified <i class="parameter"><tt>width</tt></i> and
<i class="parameter"><tt>height</tt></i>, independent of the properties set.</p></div><div class="refsect2" lang="en"><a name="method-gtkcellrenderer--get-fixed-size"></a><h3>gtk.CellRenderer.get_fixed_size</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_fixed_size</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>a tuple containing the width and height of the
cell</td></tr></tbody></table><p>The <tt class="methodname">get_fixed_size</tt>() method retrieves a
tuple containing the fixed <i class="parameter"><tt>width</tt></i> and
<i class="parameter"><tt>height</tt></i> of the cell.</p></div></div><div class="refsect1" lang="en"><a name="id3305530"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkcellrenderer--editing-canceled"></a><h3>The "editing-canceled" gtk.CellRenderer 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>cellrenderer</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>cellrenderer</tt></i>:</span></td><td>the cellrenderer that received the
signal</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><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "editing-canceled" signal is emitted when the user cancels
      the process of editing a cell. For example, an editable cell renderer
      could be written to cancel editing when the user presses Escape. Also
      see the <a href="class-gtkcellrenderer.html#method-gtkcellrenderer--editing-canceled" title="gtk.CellRenderer.editing_canceled"><tt class="methodname">editing_canceled</tt>()</a>
      method.</p></div><div class="refsect2" lang="en"><a name="signal-gtkcellrenderer--editing-started"></a><h3>The "editing-started" gtk.CellRenderer 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>cellrenderer</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>editable</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>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>cellrenderer</tt></i>:</span></td><td>the cellrenderer that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>editable</tt></i>:</span></td><td>the <a href="class-gtkcelleditable.html" title="gtk.CellEditable"><tt class="classname">gtk.CellEditable</tt></a></td></tr><tr><td><span class="term"><i class="parameter"><tt>path</tt></i>:</span></td><td>he path identifying the edited
cell</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><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.6 and above.</p></div><p>The "editing-started" signal is emitted when a cell starts to be
edited. The intended use of this signal is to do special setup on
<i class="parameter"><tt>editable</tt></i>, e.g. adding a <a href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><tt class="classname">gtk.EntryCompletion</tt></a>
or setting up additional columns in a <a href="class-gtkcombobox.html" title="gtk.ComboBox"><tt class="classname">gtk.ComboBox</tt></a>.</p><p>Note that GTK+ doesn't guarantee that cell renderers will
continue to use the same kind of widget for editing in future releases,
therefore you should check the type of editable before doing any specific
setup, as in the following example:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
def text_editing_started(cell, editable, path, data):
  if isinstance(editable, gtk.Entry):
      # ... create a GtkEntryCompletion
      completion = gtk.EntryCompletion()
      editable.set_completion(completion)
      ...
  ...
</pre></td></tr></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkcelllayout.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-gtkcellrenderercombo.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.CellLayout</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.CellRendererCombo</td></tr></table></div></body></html>