summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkcellrenderer.sgml
blob: 98adcd9687e9b27ee7f135a12ee5d71f41412183 (plain)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
<!-- ##### SECTION Title ##### -->
GtkCellRenderer

<!-- ##### SECTION Short_Description ##### -->
An object for rendering a single cell on a GdkDrawable

<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkCellRenderer is a base class of a set of objects used for
rendering a cell to a #GdkDrawable.  These objects are used primarily by
the #GtkTreeView widget, though they aren't tied to them in any
specific way.  It is worth noting that #GtkCellRenderer is not a
#GtkWidget and cannot be treated as such.
</para>

<para>
The primary use of a #GtkCellRenderer is for drawing a certain graphical
elements on a #GdkDrawable.  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 #GObject<!-- -->s property system.  Then, the
cell is measured using gtk_cell_renderer_get_size().  Finally, the cell
is rendered in the correct location using gtk_cell_renderer_render().
</para>

<para>
There are a number of rules that must be followed when writing a new
#GtkCellRenderer.  First and formost, it's important that a certain set
of properties will always yield a cell renderer of the same size,
barring a #GtkStyle change.  The #GtkCellRenderer also has a number of
generic properties that are expected to be honored by all children.
</para>

<para>
Beyond merely rendering a cell, cell renderers can optionally 
provide active user interface elements. A cell renderer can be 
<firstterm>activatable</firstterm> like #GtkCellRendererToggle, 
which toggles when it gets activated by a mouse click, or it can be 
<firstterm>editable</firstterm> like #GtkCellRendererText, which 
allows the user to edit the text using a #GtkEntry.
To make a cell renderer activatable or editable, you have to 
implement the @activate or @start_editing virtual functions, 
respectively.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
#GtkCellRendererText,#GtkCellRendererPixbuf,#GtkCellRendererToggle
</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### ENUM GtkCellRendererState ##### -->
<para>
Tells how a cell is to be rendererd.
</para>

@GTK_CELL_RENDERER_SELECTED: The cell is currently selected, and
probably has a selection colored background to render to.
@GTK_CELL_RENDERER_PRELIT: The mouse is hovering over the cell.
@GTK_CELL_RENDERER_INSENSITIVE: The cell is drawn in an insensitive manner
@GTK_CELL_RENDERER_SORTED: The cell is in a sorted row
@GTK_CELL_RENDERER_FOCUSED: The cell is in the focus row.

<!-- ##### ENUM GtkCellRendererMode ##### -->
<para>
Identifies how the user can interact with a particular cell.
</para>

@GTK_CELL_RENDERER_MODE_INERT: The cell is just for display
and cannot be interacted with.  Note that this doesn't mean that eg. the
row being drawn can't be selected -- just that a particular element of
it cannot be individually modified.
@GTK_CELL_RENDERER_MODE_ACTIVATABLE: The cell can be clicked.
@GTK_CELL_RENDERER_MODE_EDITABLE: The cell can be edited or otherwise modified.

<!-- ##### STRUCT GtkCellRenderer ##### -->
<para>

</para>


<!-- ##### SIGNAL GtkCellRenderer::editing-canceled ##### -->
<para>

</para>

@cellrenderer: the object which received the signal.

<!-- ##### SIGNAL GtkCellRenderer::editing-started ##### -->
<para>

</para>

@cellrenderer: the object which received the signal.
@arg1: 
@arg2: 

<!-- ##### ARG GtkCellRenderer:cell-background ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:cell-background-gdk ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:cell-background-set ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:editing ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:height ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:is-expanded ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:is-expander ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:mode ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:sensitive ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:visible ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:width ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:xalign ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:xpad ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:yalign ##### -->
<para>

</para>

<!-- ##### ARG GtkCellRenderer:ypad ##### -->
<para>

</para>

<!-- ##### STRUCT GtkCellRendererClass ##### -->
<para>

</para>

@parent_class: 
@get_size: 
@render: 
@activate: 
@start_editing: 
@editing_canceled: 
@editing_started: 
@_gtk_reserved1: 
@_gtk_reserved2: 

<!-- ##### FUNCTION gtk_cell_renderer_get_size ##### -->
<para>

</para>

@cell: 
@widget: 
@cell_area: 
@x_offset: 
@y_offset: 
@width: 
@height: 


<!-- ##### FUNCTION gtk_cell_renderer_render ##### -->
<para>

</para>

@cell: 
@window: 
@widget: 
@background_area: 
@cell_area: 
@expose_area: 
@flags: 


<!-- ##### FUNCTION gtk_cell_renderer_activate ##### -->
<para>

</para>

@cell: 
@event: 
@widget: 
@path: 
@background_area: 
@cell_area: 
@flags: 
@Returns: 


<!-- ##### FUNCTION gtk_cell_renderer_start_editing ##### -->
<para>

</para>

@cell: 
@event: 
@widget: 
@path: 
@background_area: 
@cell_area: 
@flags: 
@Returns: 


<!-- ##### FUNCTION gtk_cell_renderer_editing_canceled ##### -->
<para>

</para>

@cell: 


<!-- ##### FUNCTION gtk_cell_renderer_stop_editing ##### -->
<para>

</para>

@cell: 
@canceled: 


<!-- ##### FUNCTION gtk_cell_renderer_get_fixed_size ##### -->
<para>

</para>

@cell: 
@width: 
@height: 


<!-- ##### FUNCTION gtk_cell_renderer_set_fixed_size ##### -->
<para>

</para>

@cell: 
@width: 
@height: 


<!-- ##### FUNCTION gtk_cell_renderer_get_visible ##### -->
<para>

</para>

@cell: 
@Returns: 


<!-- ##### FUNCTION gtk_cell_renderer_set_visible ##### -->
<para>

</para>

@cell: 
@visible: 


<!-- ##### FUNCTION gtk_cell_renderer_get_sensitive ##### -->
<para>

</para>

@cell: 
@Returns: 


<!-- ##### FUNCTION gtk_cell_renderer_set_sensitive ##### -->
<para>

</para>

@cell: 
@sensitive: 


<!-- ##### FUNCTION gtk_cell_renderer_get_alignment ##### -->
<para>

</para>

@cell: 
@xalign: 
@yalign: 


<!-- ##### FUNCTION gtk_cell_renderer_set_alignment ##### -->
<para>

</para>

@cell: 
@xalign: 
@yalign: 


<!-- ##### FUNCTION gtk_cell_renderer_get_padding ##### -->
<para>

</para>

@cell: 
@xpad: 
@ypad: 


<!-- ##### FUNCTION gtk_cell_renderer_set_padding ##### -->
<para>

</para>

@cell: 
@xpad: 
@ypad: