diff options
author | Anders Carlsson <andersca@gnome.org> | 2004-07-04 20:35:35 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@src.gnome.org> | 2004-07-04 20:35:35 +0000 |
commit | 57f0d6a21f61616acef6589eb47e518ce85ab40e (patch) | |
tree | a920293a3dd5093ec153e1fb6f2ca1d99ddfb089 /gtk/gtkiconview.c | |
parent | 89570b5a31036cddf91ce71429b77b4df2a3caa9 (diff) | |
download | gdk-pixbuf-57f0d6a21f61616acef6589eb47e518ce85ab40e.tar.gz |
Add a simple file browser based on the icon view.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/gnome-fs-directory.png:
* demos/gtk-demo/gnome-fs-regular.png:
* demos/gtk-demo/iconview.c: (load_pixbufs), (fill_store),
(sort_func), (create_store), (item_activated), (up_clicked),
(home_clicked), (do_iconview):
Add a simple file browser based on the icon view.
* gtk/gtk.h:
Add gtk/gtkiconview.h
* gtk/gtkiconview.c: (gtk_icon_view_layout),
(gtk_icon_view_item_new), (gtk_icon_view_item_activated):
Fix a few bugs discovered while writing the demo.
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r-- | gtk/gtkiconview.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 8ac72d48b..a7b83b052 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -47,8 +47,6 @@ typedef struct { - gint ref_count; - GtkTreeIter iter; int index; @@ -1476,7 +1474,10 @@ gtk_icon_view_layout (GtkIconView *icon_view) GList *icons; GtkWidget *widget; gint row; - + + if (!VALID_MODEL_AND_COLUMNS (icon_view)) + return; + widget = GTK_WIDGET (icon_view); icons = icon_view->priv->items; @@ -1824,7 +1825,6 @@ gtk_icon_view_item_new (void) item = g_new0 (GtkIconViewItem, 1); - item->ref_count = 1; item->width = -1; item->height = -1; @@ -3146,6 +3146,8 @@ gtk_icon_view_get_selected_items (GtkIconView *icon_view) * * Selects all the icons. @icon_view must has its selection mode set * to #GTK_SELECTION_MULTIPLE. + * + * Since: 2.6 **/ void gtk_icon_view_select_all (GtkIconView *icon_view) @@ -3179,6 +3181,8 @@ gtk_icon_view_select_all (GtkIconView *icon_view) * @icon_view: A #GtkIconView. * * Unselects all the icons. + * + * Since: 2.6 **/ void gtk_icon_view_unselect_all (GtkIconView *icon_view) @@ -3202,6 +3206,8 @@ gtk_icon_view_unselect_all (GtkIconView *icon_view) * selected. If @icon does not point to a valid location, %FALSE is returned. * * Return value: %TRUE if @path is selected. + * + * Since: 2.6 **/ gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view, @@ -3228,10 +3234,15 @@ gtk_icon_view_path_is_selected (GtkIconView *icon_view, * @path: The #GtkTreePath to be activated * * Activates the item determined by @path. + * + * Since: 2.6 **/ void gtk_icon_view_item_activated (GtkIconView *icon_view, GtkTreePath *path) { + g_return_if_fail (GTK_IS_ICON_VIEW (icon_view)); + g_return_if_fail (path != NULL); + g_signal_emit (G_OBJECT (icon_view), icon_view_signals[ITEM_ACTIVATED], 0, path); } |