Package: gtk

Class gtk-cell-renderer

Superclasses

g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

Direct Slots

cell-background
The cell-background property of type :string (Write)
Cell background color as a string.
Default value: nil
cell-background-gdk
The cell-background-gdk property of type gdk-color (Read / Write)
Cell background color.
Warning: The cell-background-gdk property has been deprecated since version 3.4 and should not be used in newly written code. Use the cell-background-rgba property instead.
cell-background-rgba
The cell-background-rgba property of type gdk-rgba (Read / Write)
Cell background RGBA color.
cell-background-set
The cell-background-set property of type :boolean (Read / Write)
Whether this tag affects the cell background color.
Default value: false
editing
The editing property of type :boolean (Read)
Whether the cell renderer is currently in editing mode.
Default value: false
height
The height property of type :int (Read / Write)
The fixed height.
Allowed values: >= -1
Default value: -1
is-expanded
The is-expanded property of type :boolean (Read / Write)
Row is an expander row, and is expanded.
Default value: false
is-expander
The is-expander property of type :boolean (Read / Write)
Row has children.
Default value: false
mode
The mode property of type gtk-cell-renderer-mode (Read / Write)
Editable mode of the cell renderer.
Default value: :inert
sensitive
The sensitive property of type :boolean (Read / Write)
Display the cell sensitive.
Default value: true
visible
The visible property of type :boolean (Read / Write)
Display the cell.
Default value: true
width
The width property of type :int (Read / Write)
The fixed width.
Allowed values: >= -1
Default value: -1
xalign
The xalign property of type :float (Read / Write)
The horizontal alignment, from 0.0 (left) to 1.0 (right). Reversed for RTL layouts.
Allowed values: [0.0,1.0]
Default value: 0.5
xpad
The xpad property of type :uint (Read / Write)
The amount of space to add on the left and right, in pixels.
Default value: 0
yalign
The yalign property of type :float (Read / Write)
The vertical alignment, from 0.0 (top) to 1.0 (bottom).
Allowed values: [0.0,1.0]
Default value: 0.5
ypad
The ypad property of tpye :uint (Read / Write)
The amount of space to add on the top and bottom, in pixels.
Default value: 0

Details

The gtk-cell-renderer class is a base class of a set of objects used for rendering a cell to a cairo-t context. These objects are used primarily by the gtk-tree-view widget, though they are not tied to them in any specific way. It is worth noting that the gtk-cell-renderer object is not a gtk-widget object and cannot be treated as such.

The primary use of a gtk-cell-renderer object is for drawing a certain graphical elements on a Cairo context. Typically, one cell renderer is used to draw many cells on the screen. To this extent, it is not expected that a gtk-cell-renderer object keep any permanent state around. Instead, any state is set just prior to use using GObjects property system. Then, the cell is measured using the function gtk-cell-renderer-preferred-size. Finally, the cell is rendered in the correct location using the function gtk-cell-renderer-render.

There are a number of rules that must be followed when writing a new gtk-cell-renderer. First and formost, its important that a certain set of properties will always yield a cell renderer of the same size, barring a GtkStyle change. The gtk-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 the gtk-cell-renderer-toggle object, which toggles when it gets activated by a mouse click, or it can be "editable" like the gtk-cell-renderer-text object, which allows the user to edit the text using a gtk-entry widget. To make a cell renderer activatable or editable, you have to implement the GtkCellRendererClass.activate or GtkCellRendererClass.start_editing virtual functions, respectively.

Many properties of the gtk-cell-renderer class and its subclasses have a corresponding set property, e.g. cell-background-set corresponds to cell-background. These set properties reflect whether a property has been set or not. You should not set them independently.

Signal Details

The "editing-canceled" signal
 lambda (renderer)    :run-first      
The 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 the Escape key. See also the gtk-cell-renderer-stop-editing function.
renderer
The gtk-cell-renderer object which received the signal.
The "editing-started" signal
 lambda (renderer editable path)    :run-first      
The 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 gtk-entry-completion object or setting up additional columns in a gtk-combo-box widget. Note that GTK does not 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 the editable argument before doing any specific setup.
renderer
The gtk-cell-renderer object which received the signal.
editable
The gtk-cell-editable widget.
path
A string with the path identifying the edited cell.
 

Slot Access Functions

Inherited Slot Access Functions

See also

2021-3-2