ExoCellRendererIcon

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

## Synopsis

    #include <exo/exo.h>

                        ExoCellRendererIcon;
    GtkCellRenderer *   exo_cell_renderer_icon_new          (void);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkCellRenderer
                         +----ExoCellRendererIcon

## Properties

      "follow-state"             gboolean              : Read / Write / Construct
      "icon"                     gchar*                : Read / Write
      "size"                     gint                  : Read / Write / Construct

## 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.

## Details

### ExoCellRendererIcon

    typedef struct _ExoCellRendererIcon ExoCellRendererIcon;

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

### 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

## Property Details

### The `"follow-state"` property

      "follow-state"             gboolean              : Read / Write / Construct

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.

Default value: TRUE

Since 0.3.1.9

### The `"icon"` property

      "icon"                     gchar*                : Read / Write

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.

Default value: NULL

Since 0.3.1.9

### The `"size"` property

      "size"                     gint                  : Read / Write / Construct

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.

Allowed values: >= 1

Default value: 48

Since 0.3.1.9

## See Also

ExoIconView