Next: , Previous: GtkCellRendererCombo, Up: Top


47 GtkCellRendererPixbuf

Renders a pixbuf in a cell

47.1 Overview

A <gtk-cell-renderer-pixbuf> can be used to render an image in a cell. It allows to render either a given <gdk-pixbuf> (set via the pixbuf property) or a stock icon (set via the stock-id property).

To support the tree view, <gtk-cell-renderer-pixbuf> also supports rendering two alternative pixbufs, when the is-expander property is ‘#t’. If the is-expanded property is ‘#t’ and the pixbuf-expander-open property is set to a pixbuf, it renders that pixbuf, if the is-expanded property is ‘#f’ and the pixbuf-expander-closed property is set to a pixbuf, it renders that one.

47.2 Usage

— Class: <gtk-cell-renderer-pixbuf>

Derives from <gtk-cell-renderer>.

This class defines the following slots:

pixbuf
The pixbuf to render
pixbuf-expander-open
Pixbuf for open expander
pixbuf-expander-closed
Pixbuf for closed expander
stock-id
The stock ID of the stock icon to render
stock-size
The GtkIconSize value that specifies the size of the rendered icon
stock-detail
Render detail to pass to the theme engine
follow-state
Whether the rendered pixbuf should be colorized according to the state
icon-name
The name of the icon from the icon theme
— Function: gtk-cell-renderer-pixbuf-new ⇒  (ret <gtk-cell-renderer>)

Creates a new <gtk-cell-renderer-pixbuf>. Adjust rendering parameters using object properties. Object properties can be set globally (with g-object-set). Also, with <gtk-tree-view-column>, you can bind a property to a value in a <gtk-tree-model>. 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 <gtk-tree-view>.

ret
the new cell renderer