aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-18 08:23:55 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-18 08:23:55 +0000
commitfaaac0e31528524f9fd39f5d71031cd483c3029b (patch)
treeb62b871b1ef7bfee73174050f529dbc44f8799b4
parent9c5ba0f5d1152b32e96c16f28418aed5da648889 (diff)
downloadgnunet-gtk-faaac0e31528524f9fd39f5d71031cd483c3029b.tar.gz
gnunet-gtk-faaac0e31528524f9fd39f5d71031cd483c3029b.zip
-LRN: delete pop up menu when done
-rw-r--r--src/fs/gnunet-fs-gtk-event_handler.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/fs/gnunet-fs-gtk-event_handler.c b/src/fs/gnunet-fs-gtk-event_handler.c
index c077bcf4..aa870b0c 100644
--- a/src/fs/gnunet-fs-gtk-event_handler.c
+++ b/src/fs/gnunet-fs-gtk-event_handler.c
@@ -138,6 +138,15 @@ copy_uri_to_clipboard_ctx_menu (GtkMenuItem *item, gpointer user_data);
138static void 138static void
139free_search_result (struct SearchResult *sr); 139free_search_result (struct SearchResult *sr);
140 140
141void
142search_list_popup_selection_done (GtkMenuShell *menushell,
143 gpointer user_data)
144{
145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
146 "Item selected in menu shell %x\n", menushell);
147 gtk_widget_destroy (GTK_WIDGET (menushell));
148}
149
141static gboolean 150static gboolean
142search_list_popup (GtkTreeView *tv, struct SearchTab *tab, GdkEventButton *event_button) 151search_list_popup (GtkTreeView *tv, struct SearchTab *tab, GdkEventButton *event_button)
143{ 152{
@@ -239,9 +248,11 @@ search_list_popup (GtkTreeView *tv, struct SearchTab *tab, GdkEventButton *event
239 (gtk_bin_get_child (GTK_BIN (child))), TRUE); 248 (gtk_bin_get_child (GTK_BIN (child))), TRUE);
240 gtk_widget_show (child); 249 gtk_widget_show (child);
241 250
251 g_signal_connect (menu, "selection-done",
252 G_CALLBACK (search_list_popup_selection_done), NULL);
253
242 gtk_menu_shell_append (GTK_MENU_SHELL (menu), child); 254 gtk_menu_shell_append (GTK_MENU_SHELL (menu), child);
243 gtk_menu_popup (menu, NULL, NULL, NULL, NULL, init_button, event_time); 255 gtk_menu_popup (menu, NULL, NULL, NULL, NULL, init_button, event_time);
244 /* FIXME: attach some kind of handler to destroy the menu */
245 return TRUE; 256 return TRUE;
246} 257}
247 258