Skip to content

Gtk.CellRendererPixbuf

class — extends CellRenderer

:::warning Deprecated since 4.10 This API is deprecated. :::

Renders a pixbuf in a cell

A GtkCellRendererPixbuf can be used to render an image in a cell. It allows to render either a given GdkPixbuf (set via the GtkCellRendererPixbuf:pixbuf property) or a named icon (set via the GtkCellRendererPixbuf:icon-name property).

To support the tree view, GtkCellRendererPixbuf also supports rendering two alternative pixbufs, when the GtkCellRenderer:is-expander property is True. If the GtkCellRenderer:is-expanded property is True and the GtkCellRendererPixbuf:pixbuf-expander-open property is set to a pixbuf, it renders that pixbuf, if the GtkCellRenderer:is-expanded property is False and the GtkCellRendererPixbuf:pixbuf-expander-closed property is set to a pixbuf, it renders that one.

Constructors

new

@classmethod
def new(cls) -> CellRenderer

:::warning Deprecated since 4.10 This API is deprecated. :::

Creates a new GtkCellRendererPixbuf. Adjust rendering parameters using object properties. Object properties can be set globally (with g_object_set()). Also, with GtkTreeViewColumn, you can bind a property to a value in a GtkTreeModel. For example, you can bind the “pixbuf” property on the cell renderer to a pixbuf value in the model, thus rendering a different image in each row of the GtkTreeView.

Properties

gicon

gicon: Gio.Icon  # read/write

The GIcon representing the icon to display. If the icon theme is changed, the image will be updated automatically.

icon_name

icon_name: str  # read/write

The name of the themed icon to display. This property only has an effect if not overridden by the "pixbuf" property.

icon_size

icon_size: IconSize | int  # read/write

The GtkIconSize value that specifies the size of the rendered icon.

pixbuf

pixbuf: GdkPixbuf.Pixbuf  # read/write

pixbuf_expander_closed

pixbuf_expander_closed: GdkPixbuf.Pixbuf  # read/write

pixbuf_expander_open

pixbuf_expander_open: GdkPixbuf.Pixbuf  # read/write

texture

texture: Gdk.Texture  # read/write