GtkCellRendererPixbuf — Renders a pixbuf in a cell
GIcon * | gicon | Read / Write |
char * | icon-name | Read / Write |
GtkIconSize | icon-size | Read / Write |
GdkPixbuf * | pixbuf | Write |
GdkPixbuf * | pixbuf-expander-closed | Read / Write |
GdkPixbuf * | pixbuf-expander-open | Read / Write |
GdkTexture * | texture | Read / Write |
GObject ╰── GInitiallyUnowned ╰── GtkCellRenderer ╰── GtkCellRendererPixbuf
#include <gtk/gtk.h>
A GtkCellRendererPixbuf can be used to render an image in a cell. It allows to render either a given GdkPixbuf (set via the “pixbuf” property) or a named icon (set via the “icon-name” property).
To support the tree view, GtkCellRendererPixbuf also supports rendering two alternative pixbufs, when the “is-expander” property is TRUE
. If the “is-expanded” property is TRUE
and the “pixbuf-expander-open” property is set to a pixbuf, it renders that pixbuf, if the “is-expanded” property is FALSE
and the “pixbuf-expander-closed” property is set to a pixbuf, it renders that one.
GtkCellRenderer *
gtk_cell_renderer_pixbuf_new (void
);
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.
the new cell renderer
typedef struct _GtkCellRendererPixbuf GtkCellRendererPixbuf;
“gicon”
property“gicon” GIcon *
The GIcon representing the icon to display. If the icon theme is changed, the image will be updated automatically.
Owner: GtkCellRendererPixbuf
Flags: Read / Write
“icon-name”
property“icon-name” char *
The name of the themed icon to display. This property only has an effect if not overridden by the "pixbuf" property.
Owner: GtkCellRendererPixbuf
Flags: Read / Write
Default value: NULL
“icon-size”
property“icon-size” GtkIconSize
The GtkIconSize value that specifies the size of the rendered icon.
Owner: GtkCellRendererPixbuf
Flags: Read / Write
Default value: GTK_ICON_SIZE_INHERIT
“pixbuf”
property“pixbuf” GdkPixbuf *
The pixbuf to render.
Owner: GtkCellRendererPixbuf
Flags: Write
“pixbuf-expander-closed”
property“pixbuf-expander-closed” GdkPixbuf *
Pixbuf for closed expander.
Owner: GtkCellRendererPixbuf
Flags: Read / Write
“pixbuf-expander-open”
property“pixbuf-expander-open” GdkPixbuf *
Pixbuf for open expander.
Owner: GtkCellRendererPixbuf
Flags: Read / Write
“texture”
property“texture” GdkTexture *
The texture to render.
Owner: GtkCellRendererPixbuf
Flags: Read / Write
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkCellRendererPixbuf.html