ExoCellRendererIcon: Exo Reference Manual

## ExoCellRendererIcon ExoCellRendererIcon — Renders an icon in a cell |

## Functions

GtkCellRenderer * | exo_cell_renderer_icon_new ()

## Properties

gboolean | follow-state | Read / Write / Construct
GIcon * | gicon | Read / Write
gchar * | icon | Read / Write
gint | size | Read / Write / Construct

## Types and Values

struct | ExoCellRendererIcon

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkObject
                ╰── GtkCellRenderer
                    ╰── ExoCellRendererIcon

## Includes

    #include <exo/exo.h>

## Description

An ExoCellRendererIcon can be used to render an icon in a cell. It allows to render either a named icon, which is looked up using the GtkIconTheme, or an image file loaded from the file system. The icon name or absolute path to the image file is set via the

icon property.

To support the ExoIconView (and GtkIconView), ExoCellRendererIcon supports rendering icons based on the state of the view if the

follow-state

property is set.

## Functions

### exo_cell_renderer_icon_new ()

    GtkCellRenderer *
    exo_cell_renderer_icon_new (void);

Creates a new ExoCellRendererIcon. Adjust rendering parameters using object properties, which can be set globally via `g_object_set()`. Also, with GtkCellLayout and GtkTreeViewColumn, you can bind a property to a value in a GtkTreeModel. For example you can bind the icon property on the cell renderer to an icon name in the model, thus rendering a different icon in each row of the GtkTreeView.

#### Returns

the newly allocated ExoCellRendererIcon.

Since: 0.3.1.9

## Types and Values

### struct ExoCellRendererIcon

    struct ExoCellRendererIcon;

The ExoIconChooserDialog struct contains only private fields and should not be directly accessed.

## Property Details

### The `“follow-state”` property

      “follow-state”             gboolean

Specifies whether the icon renderer should render icon based on the selection state of the items. This is necessary for ExoIconView, which doesn't draw any item state indicators itself.

Flags: Read / Write / Construct

Default value: TRUE

Since: 0.3.1.9

### The `“gicon”` property

      “gicon”                    GIcon *

The GIcon to render. May also be `NULL` in which case no icon will be rendered for the cell.

Currently only GThemedIcons are supported which are loaded using the current icon theme.

Flags: Read / Write

Since: 0.4.0

### The `“icon”` property

      “icon”                     gchar *

The name of the themed icon to render or an absolute path to an image file to render. May also be `NULL` in which case no icon will be rendered for the cell.

Image files are loaded via the thumbnail database, creating a thumbnail as necessary. The thumbnail database is also used to load scalable icons in the icon theme, because loading scalable icons is quite expensive these days.

Flags: Read / Write

Default value: NULL

Since: 0.3.1.9

### The `“size”` property

      “size”                     gint

The size in pixel at which to render the icon. This is also the fixed size that the renderer will request no matter if the actual icons are smaller than this size.

This improves the performance of the layouting in the icon and tree view, because during the layouting phase no icons will need to be loaded, but the icons will only be loaded when they need to be rendered, i.e. the view scrolls to the cell.

Flags: Read / Write / Construct

Allowed values: >= 1

Default value: 48

Since: 0.3.1.9

## See Also

ExoIconView