GtkIconList
3
GTKEXTRA Library

# GtkIconList

A file icon list widget for GTK.

## Synopsis

    #include <gtkextra.h>

                        GtkIconList;
    enum                GtkIconListMode;
                        GtkIconListItem;
    GtkWidget*          gtk_icon_list_new                   (guint icon_width,
                                                             GtkIconListMode mode);
    void                gtk_icon_list_construct             (GtkIconList *iconlist,
                                                             guint icon_width,
                                                             GtkIconListMode mode);
    void                gtk_icon_list_set_mode              (GtkIconList *iconlist,
                                                             GtkIconListMode mode);
    GtkIconListMode     gtk_icon_list_get_mode              (GtkIconList *iconlist);
    void                gtk_icon_list_set_editable          (GtkIconList *iconlist,
                                                             gboolean editable);
    gboolean            gtk_icon_list_is_editable           (GtkIconList *iconlist);
    void                gtk_icon_list_set_row_spacing       (GtkIconList *iconlist,
                                                             guint spacing);
    guint               gtk_icon_list_get_row_spacing       (GtkIconList *iconlist);
    void                gtk_icon_list_set_col_spacing       (GtkIconList *iconlist,
                                                             guint spacing);
    guint               gtk_icon_list_get_col_spacing       (GtkIconList *iconlist);
    void                gtk_icon_list_set_text_space        (GtkIconList *iconlist,
                                                             guint text_space);
    guint               gtk_icon_list_get_text_space        (GtkIconList *iconlist);
    void                gtk_icon_list_set_icon_border       (GtkIconList *iconlist,
                                                             guint border);
    guint               gtk_icon_list_get_icon_border       (GtkIconList *iconlist);
    void                gtk_icon_list_set_icon_width        (GtkIconList *iconlist,
                                                             guint width);
    guint               gtk_icon_list_get_icon_width        (GtkIconList *iconlist);
    void                gtk_icon_list_freeze                (GtkIconList *iconlist);
    void                gtk_icon_list_thaw                  (GtkIconList *iconlist);
    void                gtk_icon_list_set_background        (GtkIconList *iconlist,
                                                             GdkColor *color);
    GtkIconListItem *   gtk_icon_list_add_from_pixmap       (GtkIconList *icon_list,
                                                             GdkPixmap *pixmap,
                                                             GdkBitmap *bitmap_mask,
                                                             const gchar *label,
                                                             gpointer link);
    GtkIconListItem *   gtk_icon_list_add_from_data         (GtkIconList *iconlist,
                                                             gchar **data,
                                                             const gchar *label,
                                                             gpointer link);
    GtkIconListItem *   gtk_icon_list_add                   (GtkIconList *iconlist,
                                                             const gchar *pixmap_file,
                                                             const gchar *label,
                                                             gpointer link);
    GtkIconListItem *   gtk_icon_list_get_nth               (GtkIconList *iconlist,
                                                             guint n);
    gint                gtk_icon_list_get_index             (GtkIconList *iconlist,
                                                             GtkIconListItem *item);
    void                gtk_icon_list_remove                (GtkIconList *iconlist,
                                                             GtkIconListItem *item);
    void                gtk_icon_list_set_active_icon       (GtkIconList *iconlist,
                                                             GtkIconListItem *icon);
    void                gtk_icon_list_remove_nth            (GtkIconList *iconlist,
                                                             guint n);
    void                gtk_icon_list_update                (GtkIconList *iconlist);
    void                gtk_icon_list_clear                 (GtkIconList *iconlist);
    void                gtk_icon_list_link                  (GtkIconListItem *item,
                                                             gpointer data);
    gpointer            gtk_icon_list_get_link              (GtkIconListItem *item);
    GtkIconListItem *   gtk_icon_list_get_icon_from_link    (GtkIconList *iconlist,
                                                             gpointer data);
    GtkIconListItem *   gtk_icon_list_get_icon_at           (GtkIconList *iconlist,
                                                             gint x,
                                                             gint y);
    GtkIconListItem *   gtk_icon_list_get_active_icon       (GtkIconList *iconlist);
    GtkWidget *         gtk_icon_list_get_entry             (GtkIconListItem *item);
    GtkWidget *         gtk_icon_list_get_pixmap            (GtkIconListItem *item);
    void                gtk_icon_list_set_pixmap            (GtkIconListItem *item,
                                                             GdkPixmap *pixmap,
                                                             GdkBitmap *bitmap_mask);
    void                gtk_icon_list_set_label             (GtkIconList *iconlist,
                                                             GtkIconListItem *item,
                                                             const gchar *label);
    void                gtk_icon_list_set_selection_mode    (GtkIconList *iconlist,
                                                             gint mode);
    void                gtk_icon_list_select_icon           (GtkIconList *iconlist,
                                                             GtkIconListItem *item);
    void                gtk_icon_list_unselect_icon         (GtkIconList *iconlist,
                                                             GtkIconListItem *item);
    void                gtk_icon_list_unselect_all          (GtkIconList *iconlist);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkFixed
                                     +----GtkIconList
                                           +----GtkFileList

## Implemented Interfaces

GtkIconList implements AtkImplementorIface and GtkBuildable.

## Signals

      "activate-icon"                                  : Run Last
      "click-event"                                    : Run Last
      "deactivate-icon"                                : Run Last
      "select-icon"                                    : Run Last
      "text-changed"                                   : Run Last
      "unselect-icon"                                  : Run First

## Description

GtkIconList is a GtkFixed subclass that allows you to display a table of xpm icons with editable labels. It's completely designed from scratch with some ideas borrowed from gnome-icon-list. It contains almost all of its features and more. It can be used for file browsers and as a replacement of gnome-icon-list (without the need of using gnome libraries). Like GtkSheet, it uses the widget GtkItemEntry to edit the text fields.

## Details

### GtkIconList

    typedef struct _GtkIconList GtkIconList;

The GtkIconList structure contains only private data. It should only be accessed through the functions described below.

### enum GtkIconListMode

    typedef enum
    {
      GTK_ICON_LIST_ICON,
      GTK_ICON_LIST_TEXT_RIGHT,
      GTK_ICON_LIST_TEXT_BELOW,
    } GtkIconListMode;

### GtkIconListItem

    typedef struct {
    } GtkIconListItem;

The GtkIconListItem structure contains only private data. It should only be accessed through the functions described below.

### gtk_icon_list_new ()

    GtkWidget*          gtk_icon_list_new                   (guint icon_width,
                                                             GtkIconListMode mode);

Creates a new GtkIconList widget.

`icon_width` :

  the width of the icon

`mode` :

  GTK_ICON_LIST_ICON,GTK_ICON_LIST_TEXT_RIGHT,GTK_ICON_LIST_TEXT_BELOW

Returns :

  the newly-created GtkIconList widget.

### gtk_icon_list_construct ()

    void                gtk_icon_list_construct             (GtkIconList *iconlist,
                                                             guint icon_width,
                                                             GtkIconListMode mode);

Initialize iconlist structure.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`icon_width` :

  the width of the icon

`mode` :

  GTK_ICON_LIST_ICON,GTK_ICON_LIST_TEXT_RIGHT,GTK_ICON_LIST_TEXT_BELOW

### gtk_icon_list_set_mode ()

    void                gtk_icon_list_set_mode              (GtkIconList *iconlist,
                                                             GtkIconListMode mode);

Set the icons display mode .

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`mode` :

  GTK_ICON_LIST_ICON,GTK_ICON_LIST_TEXT_RIGHT,GTK_ICON_LIST_TEXT_BELOW

### gtk_icon_list_get_mode ()

    GtkIconListMode     gtk_icon_list_get_mode              (GtkIconList *iconlist);

Get the icons display mode .

`iconlist` :

  a GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  GTK_ICON_LIST_ICON,GTK_ICON_LIST_TEXT_RIGHT,GTK_ICON_LIST_TEXT_BELOW

### gtk_icon_list_set_editable ()

    void                gtk_icon_list_set_editable          (GtkIconList *iconlist,
                                                             gboolean editable);

Set if the user can edit the text in the editable widget or not.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`editable` :

  TUE or FALSE

### gtk_icon_list_is_editable ()

    gboolean            gtk_icon_list_is_editable           (GtkIconList *iconlist);

Get the editable status of icon list.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  TRUE or FALSE

### gtk_icon_list_set_row_spacing ()

    void                gtk_icon_list_set_row_spacing       (GtkIconList *iconlist,
                                                             guint spacing);

Set the icon spacing between rows.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`spacing` :

  spacing between rows in pixels.

### gtk_icon_list_get_row_spacing ()

    guint               gtk_icon_list_get_row_spacing       (GtkIconList *iconlist);

Get the spacing between rows.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  spacing between rows in pixels.

### gtk_icon_list_set_col_spacing ()

    void                gtk_icon_list_set_col_spacing       (GtkIconList *iconlist,
                                                             guint spacing);

Set the icon spacing between columns.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`spacing` :

  spacing between columns in pixels.

### gtk_icon_list_get_col_spacing ()

    guint               gtk_icon_list_get_col_spacing       (GtkIconList *iconlist);

Get the spacing between columns.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  spacing between columns in pixels.

### gtk_icon_list_set_text_space ()

    void                gtk_icon_list_set_text_space        (GtkIconList *iconlist,
                                                             guint text_space);

Set the text max size in pixels.

`iconlist` :

  a GtkIconList widget created with `gtk_icon_list_new()`.

`text_space` :

  distance in pixels.

### gtk_icon_list_get_text_space ()

    guint               gtk_icon_list_get_text_space        (GtkIconList *iconlist);

Get the text maximum size in pixels.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  text maximum size distance in pixels.

### gtk_icon_list_set_icon_border ()

    void                gtk_icon_list_set_icon_border       (GtkIconList *iconlist,
                                                             guint border);

Set the icon border.

`iconlist` :

  a GtkIconList widget created with `gtk_icon_list_new()`.

`border` :

  icon border in pixels.

### gtk_icon_list_get_icon_border ()

    guint               gtk_icon_list_get_icon_border       (GtkIconList *iconlist);

Get the icon border width.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  icon border width in pixels.

### gtk_icon_list_set_icon_width ()

    void                gtk_icon_list_set_icon_width        (GtkIconList *iconlist,
                                                             guint width);

Set the icon width.

`iconlist` :

  a GtkIconList widget created with `gtk_icon_list_new()`.

`width` :

  icon width in pixels.

### gtk_icon_list_get_icon_width ()

    guint               gtk_icon_list_get_icon_width        (GtkIconList *iconlist);

Get the icon width.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  icon width in pixels.

### gtk_icon_list_freeze ()

    void                gtk_icon_list_freeze                (GtkIconList *iconlist);

Freeze icon list.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

### gtk_icon_list_thaw ()

    void                gtk_icon_list_thaw                  (GtkIconList *iconlist);

Thaw(unfreeze) icon list.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

### gtk_icon_list_set_background ()

    void                gtk_icon_list_set_background        (GtkIconList *iconlist,
                                                             GdkColor *color);

Set the iconlist background color.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`color` :

  a GdkColor

### gtk_icon_list_add_from_pixmap ()

    GtkIconListItem *   gtk_icon_list_add_from_pixmap       (GtkIconList *icon_list,
                                                             GdkPixmap *pixmap,
                                                             GdkBitmap *bitmap_mask,
                                                             const gchar *label,
                                                             gpointer link);

Add a icon to the icon list.

`icon_list` :

  a GtkIconList widget created with `gtk_icon_list_new()`.

`pixmap` :

  a GdkPixmap

`bitmap_mask` :

  a GdkBitmap

`label` :

  label of the icon

`link` :

  a gpointer link to some data

Returns :

  the icon pointer

### gtk_icon_list_add_from_data ()

    GtkIconListItem *   gtk_icon_list_add_from_data         (GtkIconList *iconlist,
                                                             gchar **data,
                                                             const gchar *label,
                                                             gpointer link);

Add a icon to the icon list.

`iconlist` :

  a GtkIconList widget created with `gtk_icon_list_new()`.

`data` :

  pointer to the xpm data string

`label` :

  label of the icon

`link` :

  a data pointer

Returns :

  the icon pointer

### gtk_icon_list_add ()

    GtkIconListItem *   gtk_icon_list_add                   (GtkIconList *iconlist,
                                                             const gchar *pixmap_file,
                                                             const gchar *label,
                                                             gpointer link);

Add a icon to the icon list.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`pixmap_file` :

  from #include "file.xpm"

`label` :

  label of the icon

`link` :

  link

Returns :

  the icon pointer

### gtk_icon_list_get_nth ()

    GtkIconListItem *   gtk_icon_list_get_nth               (GtkIconList *iconlist,
                                                             guint n);

Get nth icon from the icon list.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`n` :

  icon index number.

Returns :

  a GtkIconListItem

### gtk_icon_list_get_index ()

    gint                gtk_icon_list_get_index             (GtkIconList *iconlist,
                                                             GtkIconListItem *item);

Get the index number of the icon specified by its GtkIconListItem pointer.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`item` :

  a GtkIconListItem

Returns :

  icon index number

### gtk_icon_list_remove ()

    void                gtk_icon_list_remove                (GtkIconList *iconlist,
                                                             GtkIconListItem *item);

Remove the icon from the iconlist.

`iconlist` :

  a GtkIconList widget created with `gtk_icon_list_new()`.

`item` :

  a GtkIconListItem

### gtk_icon_list_set_active_icon ()

    void                gtk_icon_list_set_active_icon       (GtkIconList *iconlist,
                                                             GtkIconListItem *icon);

Set an active icon in the icon list.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`icon` :

  a GtkIconListItem

### gtk_icon_list_remove_nth ()

    void                gtk_icon_list_remove_nth            (GtkIconList *iconlist,
                                                             guint n);

Remove nth icon from the iconlist.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`n` :

  icon index number

### gtk_icon_list_update ()

    void                gtk_icon_list_update                (GtkIconList *iconlist);

Update the icon list widget..

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

### gtk_icon_list_clear ()

    void                gtk_icon_list_clear                 (GtkIconList *iconlist);

Clear the icon list widget.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

### gtk_icon_list_link ()

    void                gtk_icon_list_link                  (GtkIconListItem *item,
                                                             gpointer data);

Add a gpointer link to a icon from the iconlist.

`item` :

  GtkIconListItem

`data` :

  a gpointer to some data

### gtk_icon_list_get_link ()

    gpointer            gtk_icon_list_get_link              (GtkIconListItem *item);

Add a gpointer link to a icon from the iconlist.

`item` :

  a GtkIconListItem

Returns :

  a gpointer to some data sed with `gtk_icon_list_link()`.

### gtk_icon_list_get_icon_from_link ()

    GtkIconListItem *   gtk_icon_list_get_icon_from_link    (GtkIconList *iconlist,
                                                             gpointer data);

Gets the icon pointer from the link attached to it.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`data` :

  a gpointer to some data

Returns :

  a GtkIconListItem

### gtk_icon_list_get_icon_at ()

    GtkIconListItem *   gtk_icon_list_get_icon_at           (GtkIconList *iconlist,
                                                             gint x,
                                                             gint y);

Get the icon situated at x,y coordinates in icon list.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`x` :

  x coordindate

`y` :

  y coordinate

Returns :

  the icon pointer

### gtk_icon_list_get_active_icon ()

    GtkIconListItem *   gtk_icon_list_get_active_icon       (GtkIconList *iconlist);

Set the iconlist background color.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

Returns :

  the icon pointer

### gtk_icon_list_get_entry ()

    GtkWidget *         gtk_icon_list_get_entry             (GtkIconListItem *item);

Get the item->entry.

`item` :

  a GtkIconListItem

Returns :

  a GtkWidget

### gtk_icon_list_get_pixmap ()

    GtkWidget *         gtk_icon_list_get_pixmap            (GtkIconListItem *item);

Get the icon pixmap.

`item` :

  a GtkIconListItem

Returns :

  a GtkWidget

### gtk_icon_list_set_pixmap ()

    void                gtk_icon_list_set_pixmap            (GtkIconListItem *item,
                                                             GdkPixmap *pixmap,
                                                             GdkBitmap *bitmap_mask);

Set the icon pixmap.

`item` :

  a GtkIconListItem

`pixmap` :

  a GdkPixmap

`bitmap_mask` :

  a GdkBitmap

### gtk_icon_list_set_label ()

    void                gtk_icon_list_set_label             (GtkIconList *iconlist,
                                                             GtkIconListItem *item,
                                                             const gchar *label);

Set the icon label.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`item` :

  a GtkIconListItem

`label` :

  icon label

### gtk_icon_list_set_selection_mode ()

    void                gtk_icon_list_set_selection_mode    (GtkIconList *iconlist,
                                                             gint mode);

Set the icon selection mode.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`mode` :

  GTK_ICON_LIST_ICON, GTK_ICON_LIST_TEXT_RIGHT, GTK_ICON_LIST_TEXT_BELOW

### gtk_icon_list_select_icon ()

    void                gtk_icon_list_select_icon           (GtkIconList *iconlist,
                                                             GtkIconListItem *item);

Select the icon specified by pointer.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`item` :

  a GtkIconListItem

### gtk_icon_list_unselect_icon ()

    void                gtk_icon_list_unselect_icon         (GtkIconList *iconlist,
                                                             GtkIconListItem *item);

Unselect the icon specified by pointer.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

`item` :

  a GtkIconListItem

### gtk_icon_list_unselect_all ()

    void                gtk_icon_list_unselect_all          (GtkIconList *iconlist);

Unselect all icons.

`iconlist` :

  GtkIconList widget created with `gtk_icon_list_new()`.

## Signal Details

### The `"activate-icon"` signal

    gboolean            user_function                      (GtkIconList     *iconlist,
                                                            GtkIconListItem *arg1,
                                                            gpointer         user_data)      : Run Last

`iconlist` :

  the object which received the signal.

`arg1` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"click-event"` signal

    void                user_function                      (GtkIconList *iconlist,
                                                            GdkEvent    *event,
                                                            gpointer     user_data)      : Run Last

`iconlist` :

  the object which received the signal.

`event` :

`user_data` :

  user data set when the signal handler was connected.

### The `"deactivate-icon"` signal

    gboolean            user_function                      (GtkIconList     *iconlist,
                                                            GtkIconListItem *arg1,
                                                            gpointer         user_data)      : Run Last

`iconlist` :

  the object which received the signal.

`arg1` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"select-icon"` signal

    gboolean            user_function                      (GtkIconList     *iconlist,
                                                            GtkIconListItem *arg1,
                                                            GdkEvent        *event,
                                                            gpointer         user_data)      : Run Last

`iconlist` :

  the object which received the signal.

`arg1` :

`event` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"text-changed"` signal

    gboolean            user_function                      (GtkIconList     *iconlist,
                                                            GtkIconListItem *arg1,
                                                            gchar           *arg2,
                                                            gpointer         user_data)      : Run Last

`iconlist` :

  the object which received the signal.

`arg1` :

`arg2` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"unselect-icon"` signal

    void                user_function                      (GtkIconList     *iconlist,
                                                            GtkIconListItem *arg1,
                                                            GdkEvent        *event,
                                                            gpointer         user_data)      : Run First

`iconlist` :

  the object which received the signal.

`arg1` :

`event` :

`user_data` :

  user data set when the signal handler was connected.