1998-03-19 Federico Mena Quintero <federico@nuclecu.unam.mx>

* gdesktop.c (desktop_icon_context_popup): It is not necessary to
	set the menu position.
	(desktop_icon_context_popup): gtk_signal_connect_object_after to the menu
	items with gtk_widget_destroy as a callback so that we can destroy
	the menu widget appropriately.
This commit is contained in:
Miguel de Icaza 1998-03-20 05:41:30 +00:00
parent 10d7865679
commit 1cdbe8dbda
2 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,11 @@
1998-03-19 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (desktop_icon_context_popup): It is not necessary to
set the menu position.
(desktop_icon_context_popup): gtk_signal_connect_object_after to the menu
items with gtk_widget_destroy as a callback so that we can destroy
the menu widget appropriately.
1998-03-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gscreen.c (display_mini_info): Implement mini status.

View File

@ -691,20 +691,24 @@ desktop_icon_context_popup (GdkEventButton *event, desktop_icon_t *di)
menu = gtk_menu_new ();
/* We connect_object_after to the items so that we can destroy
* the menu at the proper time.
*/
item = gtk_menu_item_new_with_label (_("Properties"));
gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (icon_properties), di);
gtk_signal_connect_object_after (GTK_OBJECT (item), "activate",
GTK_SIGNAL_FUNC (gtk_widget_destroy), menu);
gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
item = gtk_menu_item_new_with_label (_("Delete"));
gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (icon_delete), di);
gtk_signal_connect_object_after (GTK_OBJECT (item), "activate",
GTK_SIGNAL_FUNC (gtk_widget_destroy), menu);
gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
gtk_widget_set_uposition (menu, event->x, event->y);
gtk_signal_connect (GTK_OBJECT (menu), "deactivate", GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, 0, NULL, 3, event->time);
}