Top |
void | gtk_cell_renderer_get_size () |
void | gtk_cell_renderer_render () |
gboolean | gtk_cell_renderer_activate () |
GtkCellEditable * | gtk_cell_renderer_start_editing () |
void | gtk_cell_renderer_editing_canceled () |
void | gtk_cell_renderer_stop_editing () |
void | gtk_cell_renderer_get_fixed_size () |
void | gtk_cell_renderer_set_fixed_size () |
gboolean | gtk_cell_renderer_get_visible () |
void | gtk_cell_renderer_set_visible () |
gboolean | gtk_cell_renderer_get_sensitive () |
void | gtk_cell_renderer_set_sensitive () |
void | gtk_cell_renderer_get_alignment () |
void | gtk_cell_renderer_set_alignment () |
void | gtk_cell_renderer_get_padding () |
void | gtk_cell_renderer_set_padding () |
char * | cell-background | Write |
GdkColor * | cell-background-gdk | Read / Write |
gboolean | cell-background-set | Read / Write |
gboolean | editing | Read |
int | height | Read / Write |
gboolean | is-expanded | Read / Write |
gboolean | is-expander | Read / Write |
GtkCellRendererMode | mode | Read / Write |
gboolean | sensitive | Read / Write |
gboolean | visible | Read / Write |
int | width | Read / Write |
float | xalign | Read / Write |
guint | xpad | Read / Write |
float | yalign | Read / Write |
guint | ypad | Read / Write |
enum | GtkCellRendererState |
enum | GtkCellRendererMode |
struct | GtkCellRenderer |
struct | GtkCellRendererClass |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkCellRenderer ├── GtkCellRendererText ├── GtkCellRendererPixbuf ├── GtkCellRendererProgress ├── GtkCellRendererSpinner ╰── GtkCellRendererToggle
void gtk_cell_renderer_get_size (GtkCellRenderer *cell
,GtkWidget *widget
,const GdkRectangle *cell_area
,gint *x_offset
,gint *y_offset
,gint *width
,gint *height
);
Obtains the width and height needed to render the cell. Used by view
widgets to determine the appropriate size for the cell_area passed to
gtk_cell_renderer_render()
. If cell_area
is not NULL
, fills in the
x and y offsets (if set) of the cell relative to this location.
Please note that the values set in width
and height
, as well as those
in x_offset
and y_offset
are inclusive of the xpad and ypad properties.
cell |
||
widget |
the widget the renderer is rendering to |
|
cell_area |
The area a cell will be allocated, or |
[allow-none] |
x_offset |
location to return x offset of cell relative to |
[out][allow-none] |
y_offset |
location to return y offset of cell relative to |
[out][allow-none] |
width |
location to return width needed to render a cell, or |
[out][allow-none] |
height |
location to return height needed to render a cell, or |
[out][allow-none] |
void gtk_cell_renderer_render (GtkCellRenderer *cell
,GdkWindow *window
,GtkWidget *widget
,const GdkRectangle *background_area
,const GdkRectangle *cell_area
,const GdkRectangle *expose_area
,GtkCellRendererState flags
);
Invokes the virtual render function of the GtkCellRenderer. The three
passed-in rectangles are areas of window
. Most renderers will draw within
cell_area
; the xalign, yalign, xpad, and ypad fields of the GtkCellRenderer
should be honored with respect to cell_area
. background_area
includes the
blank space around the cell, and also the area containing the tree expander;
so the background_area
rectangles for all cells tile to cover the entire
window
. expose_area
is a clip rectangle.
cell |
||
window |
a GdkDrawable to draw to |
|
widget |
the widget owning |
|
background_area |
entire cell area (including tree expanders and maybe padding on the sides) |
|
cell_area |
area normally rendered by a cell renderer |
|
expose_area |
area that actually needs updating |
|
flags |
flags that affect rendering |
gboolean gtk_cell_renderer_activate (GtkCellRenderer *cell
,GdkEvent *event
,GtkWidget *widget
,const gchar *path
,const GdkRectangle *background_area
,const GdkRectangle *cell_area
,GtkCellRendererState flags
);
Passes an activate event to the cell renderer for possible processing. Some cell renderers may use events; for example, GtkCellRendererToggle toggles when it gets a mouse click.
cell |
||
event |
a GdkEvent |
|
widget |
widget that received the event |
|
path |
widget-dependent string representation of the event location; e.g. for GtkTreeView, a string representation of GtkTreePath |
|
background_area |
background area as passed to |
|
cell_area |
cell area as passed to |
|
flags |
render flags |
GtkCellEditable * gtk_cell_renderer_start_editing (GtkCellRenderer *cell
,GdkEvent *event
,GtkWidget *widget
,const gchar *path
,const GdkRectangle *background_area
,const GdkRectangle *cell_area
,GtkCellRendererState flags
);
Passes an activate event to the cell renderer for possible processing.
cell |
||
event |
a GdkEvent |
|
widget |
widget that received the event |
|
path |
widget-dependent string representation of the event location; e.g. for GtkTreeView, a string representation of GtkTreePath |
|
background_area |
background area as passed to |
|
cell_area |
cell area as passed to |
|
flags |
render flags |
void
gtk_cell_renderer_editing_canceled (GtkCellRenderer *cell
);
gtk_cell_renderer_editing_canceled
has been deprecated since version 2.6 and should not be used in newly-written code.
Use gtk_cell_renderer_stop_editing()
instead
Causes the cell renderer to emit the “editing-canceled” signal.
This function 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.
Since: 2.4
void gtk_cell_renderer_stop_editing (GtkCellRenderer *cell
,gboolean canceled
);
Informs the cell renderer that the editing is stopped.
If canceled
is TRUE
, the cell renderer will emit the
“editing-canceled” signal.
This function should be called by cell renderer implementations in response to the “editing-done” signal of GtkCellEditable.
Since: 2.6
void gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell
,gint *width
,gint *height
);
Fills in width
and height
with the appropriate size of cell
.
void gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell
,gint width
,gint height
);
Sets the renderer size to be explicit, independent of the properties set.
gboolean
gtk_cell_renderer_get_visible (GtkCellRenderer *cell
);
Returns the cell renderer's visibility.
Since: 2.18
void gtk_cell_renderer_set_visible (GtkCellRenderer *cell
,gboolean visible
);
Sets the cell renderer's visibility.
Since: 2.18
gboolean
gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell
);
Returns the cell renderer's sensitivity.
Since: 2.18
void gtk_cell_renderer_set_sensitive (GtkCellRenderer *cell
,gboolean sensitive
);
Sets the cell renderer's sensitivity.
Since: 2.18
void gtk_cell_renderer_get_alignment (GtkCellRenderer *cell
,gfloat *xalign
,gfloat *yalign
);
Fills in xalign
and yalign
with the appropriate values of cell
.
cell |
||
xalign |
location to fill in with the x alignment of the cell, or |
[out][allow-none] |
yalign |
location to fill in with the y alignment of the cell, or |
[out][allow-none] |
Since: 2.18
void gtk_cell_renderer_set_alignment (GtkCellRenderer *cell
,gfloat xalign
,gfloat yalign
);
Sets the renderer's alignment within its available space.
cell |
||
xalign |
the x alignment of the cell renderer |
|
yalign |
the y alignment of the cell renderer |
Since: 2.18
void gtk_cell_renderer_get_padding (GtkCellRenderer *cell
,gint *xpad
,gint *ypad
);
Fills in xpad
and ypad
with the appropriate values of cell
.
cell |
||
xpad |
location to fill in with the x padding of the cell, or |
[out][allow-none] |
ypad |
location to fill in with the y padding of the cell, or |
[out][allow-none] |
Since: 2.18
void gtk_cell_renderer_set_padding (GtkCellRenderer *cell
,gint xpad
,gint ypad
);
Sets the renderer's padding.
Since: 2.18
struct GtkCellRendererClass { GtkObjectClass parent_class; /* vtable - not signals */ void (* get_size) (GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, gint *height); void (* render) (GtkCellRenderer *cell, GdkDrawable *window, GtkWidget *widget, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, GtkCellRendererState flags); gboolean (* activate) (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, GdkRectangle *background_area, GdkRectangle *cell_area, GtkCellRendererState flags); GtkCellEditable *(* start_editing) (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, GdkRectangle *background_area, GdkRectangle *cell_area, GtkCellRendererState flags); /* Signals */ void (* editing_canceled) (GtkCellRenderer *cell); void (* editing_started) (GtkCellRenderer *cell, GtkCellEditable *editable, const gchar *path); /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); };
“cell-background”
property “cell-background” char *
Cell background color as a string.
Owner: GtkCellRenderer
Flags: Write
Default value: NULL
“cell-background-gdk”
property“cell-background-gdk” GdkColor *
Cell background color as a GdkColor.
Owner: GtkCellRenderer
Flags: Read / Write
“cell-background-set”
property “cell-background-set” gboolean
Whether this tag affects the cell background color.
Owner: GtkCellRenderer
Flags: Read / Write
Default value: FALSE
“editing”
property “editing” gboolean
Whether the cell renderer is currently in editing mode.
Owner: GtkCellRenderer
Flags: Read
Default value: FALSE
“height”
property “height” int
The fixed height.
Owner: GtkCellRenderer
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“is-expanded”
property “is-expanded” gboolean
Row is an expander row, and is expanded.
Owner: GtkCellRenderer
Flags: Read / Write
Default value: FALSE
“is-expander”
property “is-expander” gboolean
Row has children.
Owner: GtkCellRenderer
Flags: Read / Write
Default value: FALSE
“mode”
property“mode” GtkCellRendererMode
Editable mode of the CellRenderer.
Owner: GtkCellRenderer
Flags: Read / Write
Default value: GTK_CELL_RENDERER_MODE_INERT
“sensitive”
property “sensitive” gboolean
Display the cell sensitive.
Owner: GtkCellRenderer
Flags: Read / Write
Default value: TRUE
“visible”
property “visible” gboolean
Display the cell.
Owner: GtkCellRenderer
Flags: Read / Write
Default value: TRUE
“width”
property “width” int
The fixed width.
Owner: GtkCellRenderer
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“xalign”
property “xalign” float
The x-align.
Owner: GtkCellRenderer
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5
“xpad”
property “xpad” guint
The xpad.
Owner: GtkCellRenderer
Flags: Read / Write
Default value: 0
“yalign”
property “yalign” float
The y-align.
Owner: GtkCellRenderer
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5
“editing-canceled”
signalvoid user_function (GtkCellRenderer *renderer, gpointer user_data)
This signal gets 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.
See also: gtk_cell_renderer_stop_editing()
.
renderer |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 2.4
“editing-started”
signalvoid user_function (GtkCellRenderer *renderer, GtkCellEditable *editable, char *path, gpointer user_data)
This signal gets emitted when a cell starts to be edited.
The intended use of this signal is to do special setup
on editable
, e.g. adding a GtkEntryCompletion or setting
up additional columns in a GtkComboBox.
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
static void text_editing_started (GtkCellRenderer *cell, GtkCellEditable *editable, const gchar *path, gpointer data) { if (GTK_IS_ENTRY (editable)) { GtkEntry *entry = GTK_ENTRY (editable); /* ... create a GtkEntryCompletion */ gtk_entry_set_completion (entry, completion); } } |
renderer |
the object which received the signal |
|
editable |
the GtkCellEditable |
|
path |
the path identifying the edited cell |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 2.6