Superclass: gtk-object
Subclasses: cell-renderer-toggle cell-renderer-progress cell-renderer-pixbuf cell-renderer-text
The cell-renderer is a base class of a set of objects used for rendering a cell to a drawable. These objects are used primarily by the tree-view widget, though they aren't tied to them in any specific way. It is worth noting that cell-renderer is not a widget and cannot be treated as such.
The primary use of a cell-renderer is for drawing a certain graphical elements on a drawable. Typically, one cell renderer is used to draw many cells on the screen. To this extent, it isn't expected that a cell-renderer keep any permanent state around. Instead, any state is set just prior to use. 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().
There are a number of rules that must be followed when writing a new cell-renderer. First and formost, it's important that a certain set of properties will always yield a cell renderer of the same size, barring a style change. The cell-renderer also has a number of generic properties that are expected to be honored by all children.
Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be activatable like cell-renderer-toggle, which toggles when it gets activated by a mouse click, or it can be editable like cell-renderer-text, which allows the user to edit the text using a entry. To make a cell renderer activatable or editable, you have to implement the activate
or start_editing
virtual functions, respectively.
Slots:
string
. Accessor: cell-renderer-cell-background
. Write-only.
Cell background color as a string.
Default value: NIL
cell-renderer-cell-background-gdk
.
Cell background color as a color structure.
boolean
. Accessor: cell-renderer-cell-background-set
.
Whether this tag affects the cell background color.
Default value: FALSE
boolean
. Accessor: cell-renderer-editing
. Read-only.
Whether the cell renderer is currently in editing mode.
Default value: FALSE
integer
. Accessor: cell-renderer-height
.
The fixed height.
Default value: -1
boolean
. Accessor: cell-renderer-is-expanded
.
Row is an expander row, and is expanded.
Default value: FALSE
boolean
. Accessor: cell-renderer-is-expander
.
Row has children.
Default value: FALSE
cell-renderer-mode
.
Editable mode of the cell-renderer.
Default value: :inert
boolean
. Accessor: cell-renderer-sensitive
.
Display the cell sensitive.
Default value: TRUE
boolean
. Accessor: cell-renderer-visible
.
Display the cell.
Default value: TRUE
integer
. Accessor: cell-renderer-width
.
The fixed width.
Default value: -1
single-float
. Accessor: cell-renderer-xalign
.
The x-align.
Allowed values: [0,1]
Default value: 0.5
integer
. Accessor: cell-renderer-xpad
.
The xpad.
Default value: 0
single-float
. Accessor: cell-renderer-yalign
.
The y-align.
Allowed values: [0,1]
Default value: 0.5
integer
. Accessor: cell-renderer-ypad
.
The ypad.
Default value: 0
Signals:
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().
string
) => void. Options: run-first.
This signal gets emitted when a cell starts to be edited. The indended use of this signal is to do special setup on editable, e.g. adding a entry-completion or setting up additional columns in a combo-box.
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.