1 2@c %start of fragment 3 4@deftp Class <gtk-cell-renderer> 5Derives from @code{<gtk-object>}. 6 7This class defines the following slots: 8 9@table @code 10@item mode 11Editable mode of the CellRenderer 12 13@item visible 14Display the cell 15 16@item sensitive 17Display the cell sensitive 18 19@item xalign 20The x-align 21 22@item yalign 23The y-align 24 25@item xpad 26The xpad 27 28@item ypad 29The ypad 30 31@item width 32The fixed width 33 34@item height 35The fixed height 36 37@item is-expander 38Row has children 39 40@item is-expanded 41Row is an expander row, and is expanded 42 43@item cell-background 44Cell background color as a string 45 46@item cell-background-gdk 47Cell background color as a GdkColor 48 49@item cell-background-set 50Whether this tag affects the cell background color 51 52@end table 53 54@end deftp 55 56@defop Signal <gtk-cell-renderer> editing-canceled 57This signal gets emitted when the user cancels the process of editing a cell. 58For example, an editable cell renderer could be written to cancel editing when 59the user presses Escape. 60 61See also: @code{gtk-cell-renderer-editing-canceled} 62 63Since 2.4 64 65@end defop 66 67@defop Signal <gtk-cell-renderer> editing-started (arg0@tie{}@code{<gtk-cell-editable>}) (arg1@tie{}@code{<gchararray>}) 68This signal gets emitted when a cell starts to be edited. The indended use of 69this signal is to do special setup on @var{editable}, e.g. adding a 70@code{<gtk-entry-completion>} or setting up additional columns in a 71@code{<gtk-combo-box>}. 72 73Note that GTK+ doesn't guarantee that cell renderers will continue to use the 74same kind of widget for editing in future releases, therefore you should check 75the type of @var{editable} before doing any specific setup, as in the following 76example: 77 78@example 79 80static void 81text_editing_started (GtkCellRenderer *cell, 82 GtkCellEditable *editable, 83 const gchar *path, 84 gpointer data) 85@{ 86 if (GTK_IS_ENTRY (editable)) 87 @{ 88 GtkEntry *entry = GTK_ENTRY (editable); 89 90 /* ... create a GtkEntryCompletion */ 91 92 gtk_entry_set_completion (entry, completion); 93 @} 94@} 95@end example 96 97Since 2.6 98 99@end defop 100 101@deffn Function gtk-cell-renderer-render (self@tie{}@code{<gtk-cell-renderer>}) (window@tie{}@code{<gdk-window>}) (widget@tie{}@code{<gtk-widget>}) (background_area@tie{}@code{<gdk-rectangle>}) (cell_area@tie{}@code{<gdk-rectangle>}) (expose_area@tie{}@code{<gdk-rectangle>}) (flags@tie{}@code{<gtk-cell-renderer-state>}) 102@deffnx Method render 103Invokes the virtual render function of the @code{<gtk-cell-renderer>}. The three 104passed-in rectangles are areas of @var{window}. Most renderers will draw within 105@var{cell-area}; the xalign, yalign, xpad, and ypad fields of the 106@code{<gtk-cell-renderer>} should be honored with respect to @var{cell-area}. 107@var{background-area} includes the blank space around the cell, and also the 108area containing the tree expander; so the @var{background-area} rectangles for 109all cells tile to cover the entire @var{window}. @var{expose-area} is a clip 110rectangle. 111 112@table @var 113@item cell 114a @code{<gtk-cell-renderer>} 115 116@item window 117a @code{<gdk-drawable>} to draw to 118 119@item widget 120the widget owning @var{window} 121 122@item background-area 123entire cell area (including tree expanders and maybe padding on the sides) 124 125@item cell-area 126area normally rendered by a cell renderer 127 128@item expose-area 129area that actually needs updating 130 131@item flags 132flags that affect rendering 133 134@end table 135 136@end deffn 137 138@deffn Function gtk-cell-renderer-activate (self@tie{}@code{<gtk-cell-renderer>}) (event@tie{}@code{<gdk-event>}) (widget@tie{}@code{<gtk-widget>}) (path@tie{}@code{mchars}) (background_area@tie{}@code{<gdk-rectangle>}) (cell_area@tie{}@code{<gdk-rectangle>}) (flags@tie{}@code{<gtk-cell-renderer-state>}) @result{}@tie{} (ret@tie{}@code{bool}) 139@deffnx Method activate 140Passes an activate event to the cell renderer for possible processing. Some cell 141renderers may use events; for example, @code{<gtk-cell-renderer-toggle>} toggles 142when it gets a mouse click. 143 144@table @var 145@item cell 146a @code{<gtk-cell-renderer>} 147 148@item event 149a @code{<gdk-event>} 150 151@item widget 152widget that received the event 153 154@item path 155widget-dependent string representation of the event location; e.g. for 156@code{<gtk-tree-view>}, a string representation of @code{<gtk-tree-path>} 157 158@item background-area 159background area as passed to @var{gtk-cell-renderer-render} 160 161@item cell-area 162cell area as passed to @var{gtk-cell-renderer-render} 163 164@item flags 165render flags 166 167@item ret 168@samp{@code{#t}} if the event was consumed/handled 169 170@end table 171 172@end deffn 173 174@deffn Function gtk-cell-renderer-start-editing (self@tie{}@code{<gtk-cell-renderer>}) (event@tie{}@code{<gdk-event>}) (widget@tie{}@code{<gtk-widget>}) (path@tie{}@code{mchars}) (background_area@tie{}@code{<gdk-rectangle>}) (cell_area@tie{}@code{<gdk-rectangle>}) (flags@tie{}@code{<gtk-cell-renderer-state>}) @result{}@tie{} (ret@tie{}@code{<gtk-cell-editable>}) 175@deffnx Method start-editing 176Passes an activate event to the cell renderer for possible processing. 177 178@table @var 179@item cell 180a @code{<gtk-cell-renderer>} 181 182@item event 183a @code{<gdk-event>} 184 185@item widget 186widget that received the event 187 188@item path 189widget-dependent string representation of the event location; e.g. for 190@code{<gtk-tree-view>}, a string representation of @code{<gtk-tree-path>} 191 192@item background-area 193background area as passed to @var{gtk-cell-renderer-render} 194 195@item cell-area 196cell area as passed to @var{gtk-cell-renderer-render} 197 198@item flags 199render flags 200 201@item ret 202A new @code{<gtk-cell-editable>}, or @samp{@code{#f}} 203 204@end table 205 206@end deffn 207 208@deffn Function gtk-cell-renderer-editing-canceled (self@tie{}@code{<gtk-cell-renderer>}) 209@deffnx Method editing-canceled 210@samp{gtk_cell_renderer_editing_canceled} has been deprecated since version 2.6 211and should not be used in newly-written code. Use 212@code{gtk-cell-renderer-stop-editing} instead 213 214Causes the cell renderer to emit the "editing-canceled" signal. This function is 215for use only by implementations of cell renderers that need to notify the client 216program that an editing process was canceled and the changes were not committed. 217 218@table @var 219@item cell 220A @code{<gtk-cell-renderer>} 221 222@end table 223 224Since 2.4 225 226@end deffn 227 228@deffn Function gtk-cell-renderer-stop-editing (self@tie{}@code{<gtk-cell-renderer>}) (canceled@tie{}@code{bool}) 229@deffnx Method stop-editing 230Informs the cell renderer that the editing is stopped. If @var{canceled} is 231@samp{@code{#t}}, the cell renderer will emit the "editing-canceled" signal. 232This function should be called by cell renderer implementations in response to 233the "editing-done" signal of @code{<gtk-cell-editable>}. 234 235@table @var 236@item cell 237A @code{<gtk-cell-renderer>} 238 239@item canceled 240@samp{@code{#t}} if the editing has been canceled 241 242@end table 243 244Since 2.6 245 246@end deffn 247 248@deffn Function gtk-cell-renderer-get-fixed-size (self@tie{}@code{<gtk-cell-renderer>}) @result{}@tie{} (width@tie{}@code{int}) (height@tie{}@code{int}) 249@deffnx Method get-fixed-size 250Fills in @var{width} and @var{height} with the appropriate size of @var{cell}. 251 252@table @var 253@item cell 254A @code{<gtk-cell-renderer>} 255 256@item width 257location to fill in with the fixed width of the widget, or @samp{@code{#f}} 258 259@item height 260location to fill in with the fixed height of the widget, or @samp{@code{#f}} 261 262@end table 263 264@end deffn 265 266@deffn Function gtk-cell-renderer-set-fixed-size (self@tie{}@code{<gtk-cell-renderer>}) (width@tie{}@code{int}) (height@tie{}@code{int}) 267@deffnx Method set-fixed-size 268Sets the renderer size to be explicit, independent of the properties set. 269 270@table @var 271@item cell 272A @code{<gtk-cell-renderer>} 273 274@item width 275the width of the cell renderer, or -1 276 277@item height 278the height of the cell renderer, or -1 279 280@end table 281 282@end deffn 283 284 285@c %end of fragment 286