| GTK-EXTRA - Reference Manual

| Home

## Name

### Gtkiconlist - gtkiconlist widget for gtk+

## Synopsis

    GtkType

    gtk_icon_list_get_type

    (void);

    GtkType

    gtk_icon_list_item_get_type

    (void);

    GtkWidget*

    gtk_icon_list_new

    (guint icon_width,
    guint mode);

    void

    gtk_icon_list_construct

    (GtkIconList *icon_list,
    guint icon_width,
    guint mode);

    void

    gtk_icon_list_set_mode

    (GtkIconList *iconlist,
    guint mode);

    guint

    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 space);

    guint

    gtk_icon_list_get_text_space

    (GtkIconList *iconlist);

    void

    gtk_icon_list_set_icon_border

    (GtkIconList *iconlist,
    guint space);

    guint

    gtk_icon_list_get_icon_border

    (GtkIconList *iconlist);

    void

    gtk_icon_list_set_icon_width

    (GtkIconList *iconlist,
    guint space);

    guint

    gtk_icon_list_get_icon_width

    (GtkIconList *iconlist);

    void

    gtk_icon_list_freeze

    (GtkIconList *icon_list);

    void

    gtk_icon_list_thaw

    (GtkIconList *icon_list);

    void

    gtk_icon_list_set_background

    (GtkIconList *icon_list,
    GdkColor *color);

    GtkIconListItem *

    gtk_icon_list_add_from_pixmap

    (GtkIconList *icon_list,
    GdkPixmap *pixmap,
    GdkBitmap *bitmap,
    const gchar *label,
    gpointer link);

    GtkIconListItem  *

    gtk_icon_list_add_from_data

    (GtkIconList *icon_list,
    gchar **data,
    const gchar *label,
    gpointer link);

    GtkIconListItem  *

    gtk_icon_list_add

    (GtkIconList *icon_list,
    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);

    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

##
Args

## Signal Prototypes

    gboolean (*select_icon)	(GtkIconList *iconlist,
                             	 GtkIconListItem *icon,
                             	 GdkEvent *event);
    void (*unselect_icon)		(GtkIconList *iconlist,
                            	 GtkIconListItem *icon,
                             	 GdkEvent *event);
    gboolean (*text_changed)	(GtkIconList *iconlist,
                             	 GtkIconListItem *icon,
                             	 gchar *new_text);
    gboolean (*activate_icon)	(GtkIconList *iconlist,
                                     GtkIconListItem *icon);
    gboolean (*deactivate_icon)	(GtkIconList *iconlist,
                                     GtkIconListItem *icon);
    void (*click_event)		(GtkIconList *iconlist,
                             	 GdkEvent *event);

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

    struct _GtkIconList
    {
      GtkFixed fixed;
      guint8 flags;
      guint mode;
      GtkSelectionMode selection_mode;
      guint freeze_count;
      guint icon_width;
      guint text_space;   /* entry width */
      guint row_spacing;  /* space between rows */
      guint col_spacing;  /* space between columns */
      guint icon_border;  /* space between icon and entry */

      gboolean is_editable;
      GtkIconListItem *active_icon;
      GdkColor background;
      gint num_icons;
      GList *icons;
      GList *selection;
      GCompareFunc compare_func;
    };

    struct _GtkIconListItem
    {
      guint x, y;
      gint state;
      gchar *entry_label;
      gchar *label;

      GtkWidget *pixmap;
      GtkWidget *entry;
      gpointer link;
    };

    num
        {
        GTK_ICON_LIST_ICON,
        GTK_ICON_LIST_TEXT_RIGHT,
        GTK_ICON_LIST_TEXT_BELOW,
        };

    This are the values of "mode" argument.

Screenshot

### gtk_icon_list_get_type ()

    GtkType gtk_icon_list_get_type (void);

Returns |

### gtk_icon_list_item_get_type ()

    GtkType gtk_icon_list_item_get_type (void);

Returns |

### gtk_icon_list_new ()

    GtkWidget* gtk_icon_list_new (guint icon_width, guint mode);

Create a new iconlist widget.

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_construct ()

    void gtk_icon_list_construct (GtkIconList *icon_list, guint icon_width,guint mode);

Initialize iconlist structure.

icon_list | icon list 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, guint mode);

Set the dispaly mode of the icons.

iconlist | icon list 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 ()

    guint gtk_icon_list_get_mode (GtkIconList *iconlist);

Get the current display mode of the iconlist

name | name of the font
`height` | height of the font

### 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 | icon list widget created with gtk_icon_list_new()
`editable` | TRUE or FALSE

### gtk_icon_list_is_editable ()

    gboolean gtk_icon_list_is_editable (GtkIconList *iconlist);

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

iconlist | icon list 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 row spacing of the iconlist in pixels.

iconlist | icon list widget created with gtk_icon_list_new()
spacing | the distance betwwen rows in pizels

### gtk_icon_list_get_row_spacing()

    guint gtk_icon_list_get_row_spacing (GtkIconList *iconlist);

Determine row spacing of the iconlist in pixels

iconlist | icon list widget created with gtk_icon_list_new()
Returns | the distance betwwen rows in pizels

### gtk_icon_list_set_col_spacing()

    void gtk_icon_list_set_col_spacing (GtkIconList *iconlist,guint spacing);

Set col spacing of the iconlist in pixels.

iconlist | icon list widget created with gtk_icon_list_new()
spacing | the distance betwwen cols in pizels

### gtk_icon_list_get_col_spacing()

    guint gtk_icon_list_get_col_spacing (GtkIconList *iconlist);

Determine col spacing of the iconlist in pixels

iconlist | icon list widget created with gtk_icon_list_new()
Returns | the distance betwwen cols in pizels

### gtk_icon_list_set_text_space()

    void gtk_icon_list_set_text_space (GtkIconList *iconlist, guint space);

Set the text max size in pixels.

iconlist | icon list widget created with gtk_icon_list_new()
space | distance in pixels

### gtk_icon_list_get_text_space()

    guint gtk_icon_list_get_text_space (GtkIconList *iconlist);

Get the text max size in pixels.

iconlist | icon list widget created with gtk_icon_list_new()
Returns | the text max size distance in pizels

### gtk_icon_list_set_icon_border()

    void gtk_icon_list_set_icon_border (GtkIconList *iconlist, guint space);

Set icon border.

iconlist | icon list widget created with gtk_icon_list_new()
space | icon border

### gtk_icon_list_get_icon_border()

    guint gtk_icon_list_get_icon_border (GtkIconList *iconlist);

Get icon border.

iconlist | icon list widget created with gtk_icon_list_new()
Returns | icon border

### gtk_icon_list_set_icon_width()

    void gtk_icon_list_set_icon_width (GtkIconList *iconlist,guint space);

Set icon width

iconlist | icon list widget created with gtk_icon_list_new()
space | icon width

### gtk_icon_list_get_icon_width()

    guint gtk_icon_list_get_icon_width (GtkIconList *iconlist);

Get icon width

iconlist | icon list widget created with gtk_icon_list_new()
Returns | icon width

### gtk_icon_list_freeze()

    void gtk_icon_list_freeze (GtkIconList *icon_list);

Freeze icon list.

iconlist | icon list widget created with gtk_icon_list_new()

### gtk_icon_list_thaw()

    void gtk_icon_list_thaw (GtkIconList *icon_list);

Thaw(unfreeze) icon list.

iconlist | icon list widget created with gtk_icon_list_new()

### gtk_icon_list_set_background()

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

Set the iconlist background.

iconlist | icon list widget created with gtk_icon_list_new()
color | GdkColor of the background

### gtk_icon_list_add_from_pixmap()

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

iconlist | icon list widget created with gtk_icon_list_new()
pixmap |
bitmap |
label |
link |

### gtk_icon_list_add_from_data()

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

iconlist | icon list widget created with gtk_icon_list_new()
data |
label |
link |

### gtk_icon_list_add()

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

Add a icon to the icon list.

iconlist | icon list widget created with gtk_icon_list_new()
pixmap_file | from #include "file.xpm"
label | label of the icon
link | a pointer to a string ,etc..

### gtk_icon_list_get_nth()

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

Get nth icon from the icon list.

iconlist | icon list widget created with gtk_icon_list_new()
n | the number of the icon
Returns | The GtjIconListItem of the icon

### 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 | icon list widget created with gtk_icon_list_new()
item | GtkIconListItem pointer
Returns | the index number

### gtk_icon_list_remove()

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

Remove the icon from the iconlist

iconlist | icon list widget created with gtk_icon_list_new()
item | GtkIconListItem pointer

### gtk_icon_list_set_active_icon()

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

Set an icon active in iconlist.

iconlist | icon list widget created with gtk_icon_list_new()
item | GtkIconListItem pointer

### gtk_icon_list_remove_nth()

    void gtk_icon_list_remove_nth (GtkIconList *iconlist,guint n);

Remove the nth icon from the iconlist

iconlist | icon list widget created with gtk_icon_list_new()
n | the index number of the icon

### gtk_icon_list_update()

    void gtk_icon_list_update (GtkIconList *iconlist);

Update the icon list widget.

iconlist | icon list widget created with gtk_icon_list_new()

### gtk_icon_list_clear()

    void gtk_icon_list_clear (GtkIconList *iconlist);

Clear the icon list widget.

iconlist | icon list widget created with gtk_icon_list_new()

### gtk_icon_list_link()

    void gtk_icon_list_link (GtkIconListItem *item, gpointer data);

Add a link to a icon from the iconlist

item | icon pointer
data | the pointer link

### gtk_icon_list_get_link()

    gpointer gtk_icon_list_get_link (GtkIconListItem *item);

Get the link attached to a icon from the iconlist

item | icon pointer
Returns | the pointer 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 | icon list widget created with gtk_icon_list_new()
data | the pointer link
Returns | the icon pointer

### 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 in icon list

iconlist | icon list widget created with gtk_icon_list_new()
x,y | coordinates of the icon
Returns | the icon pointer

### gtk_icon_list_get_active_icon()

    GtkIconListItem *gtk_icon_list_get_active_icon  (GtkIconList *iconlist);

Get the active icon in the icon list.

iconlist | icon list 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 | item pointer
Returns | item->entry

### gtk_icon_list_get_pixmap()

    GtkWidget *gtk_icon_list_get_pixmap (GtkIconListItem *item);

Get the pixnap of the icon.

item | item pointer
Returns | item->pixmap

### gtk_icon_list_set_pixmap()

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

Set the pixnap of the icon.

item | item pointer
pixmap | GdkPixmap of the icon
bitmap | GdkBitmap of the icon

### gtk_icon_list_set_label()

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

Set the label of the icon.

iconlist | icon list widget created with gtk_icon_list_new()
item | item pointer
label | icon label

### gtk_icon_list_set_selection_mode()

    void gtk_icon_list_set_selection_mode(GtkIconList *iconlist, gint mode);

Set the selection mode of the iconlist

iconlist | icon list 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 | icon list widget created with gtk_icon_list_new()
item | item pointer

### gtk_icon_list_unselect_icon()

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

Unselect the icon specified by pointer

iconlist | icon list widget created with gtk_icon_list_new()
item | item pointer

### gtk_icon_list_unselect_all()

    void gtk_icon_list_unselect_all (GtkIconList *iconlist);

Unselect all the icons from the icon list

iconlist | icon list widget created with gtk_icon_list_new()

## Signals

### The "select_icon" signal

    gboolean (*select_icon) (GtkIconList *iconlist,
                             GtkIconListItem *icon,
                             GdkEvent *event);

Should be connected if you wish to perform an action whenever the icon is selected

`toggle_combo` : | the object which received the signal.
item | icon pointer
event | event that produced the selection of icon

### The "unselect_icon" signal

    void (*unselect_icon)		(GtkIconList *iconlist,
                            	 GtkIconListItem *icon,
                             	 GdkEvent *event);

Should be connected if you wish to perform an action whenever the icon is unselected

`toggle_combo` : | the object which received the signal.
item | icon pointer
event | event that produced the unselection of icon

### The "text_changed" signal

    gboolean (*text_changed)	(GtkIconList *iconlist,
                             	 GtkIconListItem *icon,
                             	 gchar *new_text);

Should be connected if you wish to perform an action whenever text of the icon is changed

`toggle_combo` : | the object which received the signal.
item | icon pointer
new_text | modified text

### The "activate_icon" signal

    gboolean (*activate_icon)	(GtkIconList *iconlist,
                               GtkIconListItem *icon);

Should be connected if you wish to perform an action whenever the icon is activated

`toggle_combo` : | the object which received the signal.
item | icon pointer

### The "deactivate_icon" signal

    gboolean (*deactivate_icon)	(GtkIconList *iconlist,
                                   GtkIconListItem *icon);

Should be connected if you wish to perform an action whenever the icon is deactivated

`toggle_combo` : | the object which received the signal.
item | icon pointer

### The "click_event" signal

    void (*click_event)		(GtkIconList *iconlist,
                             	 GdkEvent *event);

Should be connected if you wish to perform an action whenever an event occures.

`toggle_combo` : | the object which received the signal.
event | GdkEvent that occured

##

##

| Home |  |