Fix double-click activation.

2004-11-09  Matthias Clasen  <mclasen@redhat.com>

	* tests/testiconview.c: Fix double-click activation.
This commit is contained in:
Matthias Clasen 2004-11-09 18:08:53 +00:00 committed by Matthias Clasen
parent 857468e46c
commit 4ad562fc0c
5 changed files with 24 additions and 7 deletions

View File

@ -1,5 +1,7 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
window when appropriate. window when appropriate.
(gtk_statusbar_init): Instead of cutting the text of, make (gtk_statusbar_init): Instead of cutting the text of, make

View File

@ -1,5 +1,7 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
window when appropriate. window when appropriate.
(gtk_statusbar_init): Instead of cutting the text of, make (gtk_statusbar_init): Instead of cutting the text of, make

View File

@ -1,5 +1,7 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
window when appropriate. window when appropriate.
(gtk_statusbar_init): Instead of cutting the text of, make (gtk_statusbar_init): Instead of cutting the text of, make

View File

@ -1,5 +1,7 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip * gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip
window when appropriate. window when appropriate.
(gtk_statusbar_init): Instead of cutting the text of, make (gtk_statusbar_init): Instead of cutting the text of, make

View File

@ -23,6 +23,7 @@
#include "prop-editor.h" #include "prop-editor.h"
#define NUMBER_OF_ITEMS 10 #define NUMBER_OF_ITEMS 10
#define MANY_ITEMS 10000
static void static void
fill_model (GtkTreeModel *model) fill_model (GtkTreeModel *model)
@ -116,7 +117,7 @@ add_many (GtkWidget *button, GtkIconView *icon_list)
pixbuf = gdk_pixbuf_new_from_file ("gnome-textfile.png", NULL); pixbuf = gdk_pixbuf_new_from_file ("gnome-textfile.png", NULL);
for (i = 0; i < 100; i++) for (i = 0; i < MANY_ITEMS; i++)
{ {
str = g_strdup_printf ("Icon %d", count); str = g_strdup_printf ("Icon %d", count);
str2 = g_strdup_printf ("Icon <b>%d</b>", count); str2 = g_strdup_printf ("Icon <b>%d</b>", count);
@ -164,19 +165,27 @@ free_item_data (ItemData *data)
} }
static void static void
item_cb (GtkWidget *menuitem, item_activated (GtkIconView *icon_view,
ItemData *data) GtkTreePath *path)
{ {
GtkTreeIter iter; GtkTreeIter iter;
GtkTreeModel *model; GtkTreeModel *model;
gchar *text; gchar *text;
model = gtk_icon_view_get_model (data->icon_list);
gtk_tree_model_get_iter (model, &iter, data->path); model = gtk_icon_view_get_model (icon_view);
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter, 1, &text, -1); gtk_tree_model_get (model, &iter, 1, &text, -1);
g_print ("Item activated, text is %s\n", text); g_print ("Item activated, text is %s\n", text);
g_free (text); g_free (text);
}
static void
item_cb (GtkWidget *menuitem,
ItemData *data)
{
item_activated (data->icon_list, data->path);
} }
static void static void
@ -278,7 +287,7 @@ main (gint argc, gchar **argv)
G_CALLBACK (popup_menu_handler), NULL); G_CALLBACK (popup_menu_handler), NULL);
g_signal_connect (icon_list, "item_activated", g_signal_connect (icon_list, "item_activated",
G_CALLBACK (item_cb), icon_list); G_CALLBACK (item_activated), NULL);
model = create_model (); model = create_model ();
gtk_icon_view_set_model (GTK_ICON_VIEW (icon_list), model); gtk_icon_view_set_model (GTK_ICON_VIEW (icon_list), model);