Migrating from GnomeIconList to GtkIconView

Since version 2.6, GTK+ provides the GtkIconView widget. It is similar in
functionality to the GnomeIconList widget in the
libgnomeui library, both widgets provide a way to lay out named icons in
a grid. The distinctive feature of the GTK+ widget is that it follows the
model-view pattern, allowing it to share the actual data (i.e. the names
and images of the icons) with other views.

GtkIconView currently doesn't support some features found in
GnomeIconList. Icons can not be positioned freely,
the spacing is not customizable, and it is not possible to edit the names of
icons.

To convert an application that uses GnomeIconList
to GtkIconView, the first step is to organize your data in a GtkTreeModel.
GnomeIconList lets you directly insert data with
gnome_icon_list_insert() and gnome_icon_list_insert_pixbuf() and their
append variants. So, if you previously had a function to fill your icon
list similar to this one:

This example uses a GtkListStore as model, but part of the elegance of the
model-view pattern is that you can easily use another tree model implementation,
or even write your own custom tree model.

Your application may make use of extra data attached to the icons in the
GnomeIconList via gnome_icon_list_set_icon_data() and
gnome_icon_list_get_icon_data(). With GtkIconView such data is most
conveniently stored in an extra column in the tree model, so you would
call a function like

assuming that your tree model has a DATA_COLUMN of type
G_TYPE_POINTER.

There is a number of minor API differences between
GnomeIconList and
GtkIconView:

<typename>GnomeIconListMode</typename> is replaced by the
orientation
property of GtkIconView

GtkIconView can not be frozen in the same
way as GnomeIconList can with
gnome_icon_list_freeze() and gnome_icon_list_thaw(). Instead you can
replace the whole model of a GtkIconView,
instead of doing many small changes to the existing model.