## ExoIconBar

ExoIconBar — A widget for displaying icon bars

## Synopsis

    #include <exo/exo.h>

                        ExoIconBar;
    GtkWidget*          exo_icon_bar_new                    (void);
    GtkWidget*          exo_icon_bar_new_with_model         (GtkTreeModel *model);
    GtkTreeModel*       exo_icon_bar_get_model              (ExoIconBar *icon_bar);
    void                exo_icon_bar_set_model              (ExoIconBar *icon_bar,
                                                             GtkTreeModel *model);
    gint                exo_icon_bar_get_pixbuf_column      (ExoIconBar *icon_bar);
    void                exo_icon_bar_set_pixbuf_column      (ExoIconBar *icon_bar,
                                                             gint column);
    gint                exo_icon_bar_get_text_column        (ExoIconBar *icon_bar);
    void                exo_icon_bar_set_text_column        (ExoIconBar *icon_bar,
                                                             gint column);
    GtkOrientation      exo_icon_bar_get_orientation        (ExoIconBar *icon_bar);
    void                exo_icon_bar_set_orientation        (ExoIconBar *icon_bar,
                                                             GtkOrientation orientation);
    gint                exo_icon_bar_get_active             (ExoIconBar *icon_bar);
    void                exo_icon_bar_set_active             (ExoIconBar *icon_bar,
                                                             gint index);
    gboolean            exo_icon_bar_get_active_iter        (ExoIconBar *icon_bar,
                                                             GtkTreeIter *iter);
    void                exo_icon_bar_set_active_iter        (ExoIconBar *icon_bar,
                                                             GtkTreeIter *iter);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----ExoIconBar

## Implemented Interfaces

ExoIconBar implements AtkImplementorIface and GtkBuildable.

## Properties

      "active"                   gint                  : Read / Write
      "model"                    GtkTreeModel*         : Read / Write
      "orientation"              GtkOrientation        : Read / Write
      "pixbuf-column"            gint                  : Read / Write
      "text-column"              gint                  : Read / Write

## Style Properties

      "active-item-border-color" GdkColor*             : Read
      "active-item-fill-color"   GdkColor*             : Read
      "active-item-text-color"   GdkColor*             : Read
      "cursor-item-border-color" GdkColor*             : Read
      "cursor-item-fill-color"   GdkColor*             : Read
      "cursor-item-text-color"   GdkColor*             : Read

## Signals

      "selection-changed"                              : Run First
      "set-scroll-adjustments"                         : Run Last

## Description

A widget that displays any object that implements the GtkTreeModel interface in an icon bar.

Example 1. Creating a new ExoIconBar with a GtkListStore

    enum
    {
      PIXBUF_COLUMN,
      STRING_COLUMN,
      N_COLUMNS,
    };

    {
      GtkListStore *store;
      GtkWidget    *bar;

      /* make a new list store */
      store = gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING);

      /* fill the store with data */
      fill_store (store);

      /* create the icon bar */
      bar = exo_icon_bar_new_with_model (GTK_TREE_MODEL (store));
      exo_icon_bar_set_pixbuf_column (EXO_ICON_BAR (bar), PIXBUF_COLUMN);
      exo_icon_bar_set_text_column (EXO_ICON_BAR (bar), TEXT_COLUMN);
      gtk_widget_show (bar);

      /* the icon bar keeps a reference on the store now */
      g_object_unref (G_OBJECT (store));

      /* add the bar to your GUI now... */
    }

## Details

### ExoIconBar

    typedef struct _ExoIconBar ExoIconBar;

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

### exo_icon_bar_new ()

    GtkWidget*          exo_icon_bar_new                    (void);

Returns : | a newly allocated ExoIconBar.

### exo_icon_bar_new_with_model ()

    GtkWidget*          exo_icon_bar_new_with_model         (GtkTreeModel *model);

Creates a new ExoIconBar and associates it with `model`.

`model` : | A GtkTreeModel.
Returns : | a newly allocated ExoIconBar, which is associated with `model`.

### exo_icon_bar_get_model ()

    GtkTreeModel*       exo_icon_bar_get_model              (ExoIconBar *icon_bar);

Returns the model the ExoIconBar is based on. Returns `NULL` if the model is unset.

`icon_bar` : | A ExoIconBar.
Returns : | A GtkTreeModel, or `NULL` if none is currently being used.

### exo_icon_bar_set_model ()

    void                exo_icon_bar_set_model              (ExoIconBar *icon_bar,
                                                             GtkTreeModel *model);

Sets the model for a ExoIconBar. If the `icon_bar` already has a model set, it will remove it before settings the new model. If `model` is `NULL`, then it will unset the old model.

`icon_bar` : | A ExoIconBar.
`model` : | A GtkTreeModel or `NULL`.

### exo_icon_bar_get_pixbuf_column ()

    gint                exo_icon_bar_get_pixbuf_column      (ExoIconBar *icon_bar);

Returns the column with pixbufs for `icon_bar`.

`icon_bar` : | An ExoIconBar.
Returns : | the pixbuf column, or -1 if it's unset.

### exo_icon_bar_set_pixbuf_column ()

    void                exo_icon_bar_set_pixbuf_column      (ExoIconBar *icon_bar,
                                                             gint column);

Sets the column with pixbufs for `icon_bar` to be `column`. The pixbuf column must be of type GDK_TYPE_PIXBUF.

`icon_bar` : | An ExoIconBar.
`column` : | A column in the currently used model.

### exo_icon_bar_get_text_column ()

    gint                exo_icon_bar_get_text_column        (ExoIconBar *icon_bar);

Returns the column with text for `icon_bar`.

`icon_bar` : | An ExoIconBar.
Returns : | the text column, or -1 if it's unset.

### exo_icon_bar_set_text_column ()

    void                exo_icon_bar_set_text_column        (ExoIconBar *icon_bar,
                                                             gint column);

Sets the column with text for `icon_bar` to be `column`. The text column must be of type G_TYPE_STRING.

`icon_bar` : | An ExoIconBar.
`column` : | A column in the currently used model or -1 to use no text in `icon_bar`.

### exo_icon_bar_get_orientation ()

    GtkOrientation      exo_icon_bar_get_orientation        (ExoIconBar *icon_bar);

Retrieves the current orientation of the toolbar. See `exo_icon_bar_set_orientation()`.

`icon_bar` : | An ExoIconBar.
Returns : | The orientation of `icon_bar`.

### exo_icon_bar_set_orientation ()

    void                exo_icon_bar_set_orientation        (ExoIconBar *icon_bar,
                                                             GtkOrientation orientation);

Sets whether the `icon_bar` should appear horizontally or vertically.

`icon_bar` : | An ExoIconBar.
`orientation` : | A new GtkOrientation.

### exo_icon_bar_get_active ()

    gint                exo_icon_bar_get_active             (ExoIconBar *icon_bar);

Returns the index of the currently active item, or -1 if there's no active item.

`icon_bar` : | An ExoIconBar.
Returns : | An integer which is the index of the currently active item, or -1 if there's no active item.

### exo_icon_bar_set_active ()

    void                exo_icon_bar_set_active             (ExoIconBar *icon_bar,
                                                             gint index);

Sets the active item of `icon_bar` to be the item at `index`.

`icon_bar` : | An ExoIconBar.
`index` : | An index in the model passed during construction, or -1 to have no active item.

### exo_icon_bar_get_active_iter ()

    gboolean            exo_icon_bar_get_active_iter        (ExoIconBar *icon_bar,
                                                             GtkTreeIter *iter);

Sets `iter` to point to the current active item, if it exists.

`icon_bar` : | An ExoIconBar.
`iter` : | An uninitialized GtkTreeIter.
Returns : | `TRUE` if `iter` was set.

### exo_icon_bar_set_active_iter ()

    void                exo_icon_bar_set_active_iter        (ExoIconBar *icon_bar,
                                                             GtkTreeIter *iter);

Sets the current active item to be the one referenced by `iter`. `iter` must correspond to a path of depth one.

This can only be called if `icon_bar` is associated with GtkTreeModel.

`icon_bar` : | An ExoIconBar.
`iter` : | The GtkTreeIter.

## Property Details

### The `"active"` property

      "active"                   gint                  : Read / Write

The item which is currently active.

Allowed values: >= -1

Default value: -1

Allowed values: >= -1

Default value: -1

### The `"model"` property

      "model"                    GtkTreeModel*         : Read / Write

The model for the icon bar.

### The `"orientation"` property

      "orientation"              GtkOrientation        : Read / Write

The orientation of the icon bar.

Default value: `GTK_ORIENTATION_VERTICAL`

Default value: GTK_ORIENTATION_VERTICAL

### The `"pixbuf-column"` property

      "pixbuf-column"            gint                  : Read / Write

The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displyed. The pixbuf column must be of type GDK_TYPE_PIXBUF. Setting this property to -1 turns off the display of pixbufs.

Allowed values: >= -1

Default value: -1

### The `"text-column"` property

      "text-column"              gint                  : Read / Write

The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type G_TYPE_STRING. If this property is set to -1, no texts are displayed.

Allowed values: >= -1

Default value: -1

## Style Property Details

### The `"active-item-border-color"` style property

      "active-item-border-color" GdkColor*             : Read

Active item border color.

### The `"active-item-fill-color"` style property

      "active-item-fill-color"   GdkColor*             : Read

Active item fill color.

### The `"active-item-text-color"` style property

      "active-item-text-color"   GdkColor*             : Read

Active item text color.

### The `"cursor-item-border-color"` style property

      "cursor-item-border-color" GdkColor*             : Read

Cursor item border color.

### The `"cursor-item-fill-color"` style property

      "cursor-item-fill-color"   GdkColor*             : Read

Cursor item fill color.

### The `"cursor-item-text-color"` style property

      "cursor-item-text-color"   GdkColor*             : Read

Cursor item text color.

## Signal Details

### The `"selection-changed"` signal

    void                user_function                      (ExoIconBar *icon_bar,
                                                            gpointer    user_data)      : Run First

This signal is emitted whenever the currently selected icon changes.

`icon_bar` : | The ExoIconBar.
`user_data` : | user data set when the signal handler was connected.

### The `"set-scroll-adjustments"` signal

    void                user_function                      (ExoIconBar    *icon_bar,
                                                            GtkAdjustment *hadjustment,
                                                            GtkAdjustment *vadjustment,
                                                            gpointer       user_data)        : Run Last

Used internally to make the ExoIconBar scrollable.

`icon_bar` : | The ExoIconBar.
`hadjustment` : | The horizontal adjustment.
`vadjustment` : | The vertical adjustment.
`user_data` : | user data set when the signal handler was connected.

## See Also

GtkTreeModel, Tree and List Widget Overview