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

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
125
126
127
128
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.CellRenderer</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-gtkcelllayout.html" title="gtk.CellLayout"><link rel="next" href="class-gtkcellrendereraccel.html" title="gtk.CellRendererAccel"></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-gtkcellrendereraccel.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.CellRenderer"><a name="class-gtkcellrenderer"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.CellRenderer</h2><p>gtk.CellRenderer — a base class for objects that render on a <a class="link" href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><code class="classname">gtk.gdk.Drawable</code></a></p></div><div class="refsect1" title="Synopsis"><a name="id3744319"></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 class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a></span></span>):
<code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--get-size" title="gtk.CellRenderer.get_size">get_size</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render">render</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>window</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>expose_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--activate" title="gtk.CellRenderer.activate">activate</a></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>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--start-editing" title="gtk.CellRenderer.start_editing">start_editing</a></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>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" 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 class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--stop-editing" title="gtk.CellRenderer.stop_editing">stop_editing</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>canceled</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" 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"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" 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" title="Ancestry"><a name="id3744734"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
  +-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
    +-- <a class="link" href="class-gtkcellrenderer.html" title="gtk.CellRenderer">gtk.CellRenderer</a>
</pre></div><div class="refsect1" title="gtk.CellRenderer Properties"><a name="properties-gtkcellrenderer"></a><h2>gtk.CellRenderer Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p><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="3.5in"></colgroup><tbody><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.
Default: None.</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 class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></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. Default: False.</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. Allowed values &gt;= -1.
Default: -1.</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. Default: False.</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. Default: False.</td></tr><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 the <a class="xref" href="gtk-constants.html#gtk-cellrenderer-mode-constants" title="GTK CellRenderer Mode Constants">GTK CellRenderer Mode Constants</a>.
Default: <code class="literal">gtk.CELL_RENDERER_MODE_INERT</code>,</td></tr><tr valign="top"><td valign="top">"sensitive"</td><td valign="top">Read/Write</td><td valign="top">If True the cell is displayed as sensitive. Available in
 GTK+ 2.6 and above. Default: True.</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. Default: True.</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. Allowed values &gt;= -1.
Default: -1.</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. Allowed values between 0 and
	  1.  Default: 0.5.</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. Default: 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. Allowed values between 0 and 1.
	  Default: 0.5.</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.  Default:
	  0.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.CellRenderer Signal Prototypes"><a name="signal-prototypes-gtkcellrenderer"></a><h2>gtk.CellRenderer Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></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-gtkcellrenderer.html#signal-gtkcellrenderer--editing-canceled" title='The "editing-canceled" gtk.CellRenderer Signal'>editing-canceled</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>cellrenderer</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-gtkcellrenderer.html#signal-gtkcellrenderer--editing-started" title='The "editing-started" gtk.CellRenderer Signal'>editing-started</a>"</span></p></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>cellrenderer</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>editable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>path</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="id3745214"></a><h2>Description</h2><p>The <a class="link" href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><code class="classname">gtk.CellRenderer</code></a>
is a base class for a set of objects used for rendering a cell to a <a class="link" href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><code class="classname">gtk.gdk.Drawable</code></a>. The
<a class="link" href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><code class="classname">gtk.CellRenderer</code></a>
provides the common attributes and methods for its subclasses (<a class="link" href="class-gtkcellrendererpixbuf.html" title="gtk.CellRendererPixbuf"><code class="classname">gtk.CellRendererPixbuf</code></a>,
<a class="link" href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><code class="classname">gtk.CellRendererText</code></a>
and <a class="link" href="class-gtkcellrenderertoggle.html" title="gtk.CellRendererToggle"><code class="classname">gtk.CellRendererToggle</code></a>).</p><p>The primary use of a <a class="link" href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><code class="classname">gtk.CellRenderer</code></a>
    is for drawing a certain graphical elements on a <a class="link" href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><code class="classname">gtk.gdk.Drawable</code></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 class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--get-size" title="gtk.CellRenderer.get_size"><code class="methodname">get_size</code>()</a>
    method. Finally, the cell is rendered in the correct location using the
    <a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><code class="methodname">render</code>()</a>
    method.</p></div><div class="refsect1" title="Methods"><a name="id3745302"></a><h2>Methods</h2><div class="refsect2" title="gtk.CellRenderer.get_size"><a name="method-gtkcellrenderer--get-size"></a><h3>gtk.CellRenderer.get_size</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_size</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</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>widget</code></strong> :</span></p></td><td>the widget the renderer is rendering
to</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cell_area</code></strong> :</span></p></td><td>The area a cell will be allocated, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a tuple containing the xoffset, yoffset, width
and height</td></tr></tbody></table><p>The <code class="methodname">get_size</code>() 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.
<code class="methodname">get_size</code>() is used by view widgets to determine the
appropriate size for the <em class="parameter"><code>cell_area</code></em> to be passed to
the <a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><code class="function">gtk.CellRenderer.render()</code></a> 
method. If <em class="parameter"><code>cell_area</code></em> is not <code class="literal">None</code>,
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" title="gtk.CellRenderer.render"><a name="method-gtkcellrenderer--render"></a><h3>gtk.CellRenderer.render</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">render</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>window</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>expose_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</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>window</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><code class="classname">gtk.gdk.Drawable</code></a>
to draw to</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>widget</code></strong> :</span></p></td><td>the widget owning
<em class="parameter"><code>window</code></em></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>background_area</code></strong> :</span></p></td><td>entire cell area (including tree expanders and
maybe padding on the sides)</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cell_area</code></strong> :</span></p></td><td>area normally rendered by a cell
renderer</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>expose_area</code></strong> :</span></p></td><td>area that actually needs
updating</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>flags</code></strong> :</span></p></td><td>flags that affect
rendering</td></tr></tbody></table><p>The <code class="methodname">render</code>() method invokes the virtual
render function of the <a class="link" href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><code class="classname">gtk.CellRenderer</code></a>. 
The three passed-in rectangles are areas of <em class="parameter"><code>window</code></em>.
Most renderers will draw within <em class="parameter"><code>cell_area</code></em>; the
xalign, yalign, xpad, and ypad properties of the <a class="link" href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><code class="classname">gtk.CellRenderer</code></a> 
should be honored with respect to <em class="parameter"><code>cell_area</code></em>.
<em class="parameter"><code>background_area</code></em> includes the blank space around the
cell, and also the area containing the tree expander; so the
<em class="parameter"><code>background_area</code></em> rectangles for all cells tile to
cover the entire <em class="parameter"><code>window</code></em>.
<em class="parameter"><code>expose_area</code></em> is a clip rectangle.</p><p>The <em class="parameter"><code>flags</code></em> value is one of:
<code class="literal">gtk.CELL_RENDERER_SELECTED</code>,
<code class="literal">gtk.CELL_RENDERER_PRELIT</code>,
<code class="literal">gtk.CELL_RENDERER_INSENSITIVE</code> or
<code class="literal">gtk.CELL_RENDERER_SORTED</code></p></div><div class="refsect2" title="gtk.CellRenderer.activate"><a name="method-gtkcellrenderer--activate"></a><h3>gtk.CellRenderer.activate</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">activate</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>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</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</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkevent.html" title="gtk.gdk.Event"><code class="classname">gtk.gdk.Event</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>widget</code></strong> :</span></p></td><td>widget that received the
event</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>path</code></strong> :</span></p></td><td>widget-dependent string representation of the
event location; e.g. for <a class="link" href="class-gtktreeview.html" title="gtk.TreeView"><code class="classname">gtk.TreeView</code></a>, a
string representation of
<code class="literal">gtk.TreePath</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>background_area</code></strong> :</span></p></td><td>background area as passed to <a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><code class="methodname">render</code>()</a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cell_area</code></strong> :</span></p></td><td>cell area as passed to <a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><code class="methodname">render</code>()</a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>flags</code></strong> :</span></p></td><td>render flags</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the event was
consumed/handled</td></tr></tbody></table><p>The <code class="methodname">activate</code>() method passes an
activate event to the cell renderer for possible processing.  Some cell
renderers may use events; for example, <a class="link" href="class-gtkcellrenderertoggle.html" title="gtk.CellRendererToggle"><code class="classname">gtk.CellRendererToggle</code></a> 
toggles when it gets a mouse click.</p><p>The <em class="parameter"><code>flags</code></em> value is one of:
<code class="literal">gtk.CELL_RENDERER_SELECTED</code>,
<code class="literal">gtk.CELL_RENDERER_PRELIT</code>,
<code class="literal">gtk.CELL_RENDERER_INSENSITIVE</code> or
<code class="literal">gtk.CELL_RENDERER_SORTED</code></p></div><div class="refsect2" title="gtk.CellRenderer.start_editing"><a name="method-gtkcellrenderer--start-editing"></a><h3>gtk.CellRenderer.start_editing</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">start_editing</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>widget</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>background_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cell_area</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>flags</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</code></strong> :</span></p></td><td>a <a class="link" href="class-gdkevent.html" title="gtk.gdk.Event"><code class="classname">gtk.gdk.Event</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>widget</code></strong> :</span></p></td><td>the widget that received the
event</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>path</code></strong> :</span></p></td><td>a widget-dependent string representation of the
event location; e.g. for <a class="link" href="class-gtktreeview.html" title="gtk.TreeView"><code class="classname">gtk.TreeView</code></a>, a
string representation of
<code class="literal">gtk.TreePath</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>background_area</code></strong> :</span></p></td><td>background area as passed to <a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><code class="methodname">render</code>()</a>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cell_area</code></strong> :</span></p></td><td>cell area as passed to <a class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--render" title="gtk.CellRenderer.render"><code class="methodname">render</code>()</a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>flags</code></strong> :</span></p></td><td>render flags</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-gtkcelleditable.html" title="gtk.CellEditable"><code class="classname">gtk.CellEditable</code></a>, 
or <code class="literal">None</code></td></tr></tbody></table><p>The <code class="methodname">start_editing</code>() method initiates
the editing of a cell.</p></div><div class="refsect2" title="gtk.CellRenderer.editing_canceled"><a name="method-gtkcellrenderer--editing-canceled"></a><h3>gtk.CellRenderer.editing_canceled</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">editing_canceled</span>(<span class="methodparam"></span>)</code></pre><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><div class="warning" title="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 class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--stop-editing" title="gtk.CellRenderer.stop_editing"><code class="methodname">stop_editing</code>()</a>
method instead.</p></div><p>The <code class="methodname">editing_canceled</code>() 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" title="gtk.CellRenderer.stop_editing"><a name="method-gtkcellrenderer--stop-editing"></a><h3>gtk.CellRenderer.stop_editing</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">stop_editing</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>canceled</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>canceled</code></strong> :</span></p></td><td>if <code class="literal">True</code> the editing has been
canceled</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.6 and above.</p></div><p>The <code class="methodname">stop_editing</code>() method informs the
cell renderer that the editing is stopped. If
<em class="parameter"><code>canceled</code></em> is <code class="literal">True</code>, 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 class="link" href="class-gtkcelleditable.html" title="gtk.CellEditable"><code class="classname">gtk.CellEditable</code></a>.</p></div><div class="refsect2" title="gtk.CellRenderer.set_fixed_size"><a name="method-gtkcellrenderer--set-fixed-size"></a><h3>gtk.CellRenderer.set_fixed_size</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_fixed_size</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</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>width</code></strong> :</span></p></td><td>the width of the cell renderer, or
-1</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td>the height of the cell renderer, or
-1</td></tr></tbody></table><p>The <code class="methodname">set_fixed_size</code>() method sets the
renderer size to the specified <em class="parameter"><code>width</code></em> and
<em class="parameter"><code>height</code></em>, independent of the properties set.</p></div><div class="refsect2" title="gtk.CellRenderer.get_fixed_size"><a name="method-gtkcellrenderer--get-fixed-size"></a><h3>gtk.CellRenderer.get_fixed_size</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_fixed_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>a tuple containing the width and height of the
cell</td></tr></tbody></table><p>The <code class="methodname">get_fixed_size</code>() method retrieves a
tuple containing the fixed <em class="parameter"><code>width</code></em> and
<em class="parameter"><code>height</code></em> of the cell.</p></div></div><div class="refsect1" title="Signals"><a name="id3746604"></a><h2>Signals</h2><div class="refsect2" title='The "editing-canceled" gtk.CellRenderer Signal'><a name="signal-gtkcellrenderer--editing-canceled"></a><h3>The "editing-canceled" gtk.CellRenderer Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>cellrenderer</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>cellrenderer</code></em> :</span></p></td><td>the cellrenderer that received the
signal</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><div class="note" title="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 class="link" href="class-gtkcellrenderer.html#method-gtkcellrenderer--editing-canceled" title="gtk.CellRenderer.editing_canceled"><code class="methodname">editing_canceled</code>()</a>
      method.</p></div><div class="refsect2" title='The "editing-started" gtk.CellRenderer Signal'><a name="signal-gtkcellrenderer--editing-started"></a><h3>The "editing-started" gtk.CellRenderer Signal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>cellrenderer</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>editable</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>path</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>cellrenderer</code></em> :</span></p></td><td>the cellrenderer that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>editable</code></em> :</span></p></td><td>the <a class="link" href="class-gtkcelleditable.html" title="gtk.CellEditable"><code class="classname">gtk.CellEditable</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td><td>he path identifying the edited
cell</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><div class="note" title="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
<em class="parameter"><code>editable</code></em>, e.g. adding a <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
or setting up additional columns in a <a class="link" href="class-gtkcombobox.html" title="gtk.ComboBox"><code class="classname">gtk.ComboBox</code></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><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></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-gtkcellrendereraccel.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.CellRendererAccel</td></tr></table></div></body></html>