[easytag] Attach popup menus to the associated widgets



commit b3977e52c20d6488048b29ef4da3a5862f7b3158
Author: David King <amigadave amigadave com>
Date:   Sun Mar 24 14:40:21 2013 +0000

    Attach popup menus to the associated widgets

 src/log.c  |   11 +++++++----
 src/misc.c |    9 ++++++---
 2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/log.c b/src/log.c
index 47b9c7a..908691e 100644
--- a/src/log.c
+++ b/src/log.c
@@ -77,7 +77,8 @@ struct _Log_Data
 /**************
  * Prototypes *
  **************/
-static gboolean Log_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event);
+static gboolean Log_Popup_Menu_Handler (GtkWidget *treeview,
+                                        GdkEventButton *event, GtkMenu *menu);
 static void Log_List_Set_Row_Visible (GtkTreeModel *treeModel,
                                       GtkTreeIter *rowIter);
 static void Log_Print_Tmp_List (void);
@@ -154,8 +155,9 @@ GtkWidget *Create_Log_Area (void)
 
     // Create Popup Menu on browser album list
     PopupMenu = gtk_ui_manager_get_widget(UIManager, "/LogPopup");
-    g_signal_connect_swapped(G_OBJECT(LogList),"button_press_event",
-                             G_CALLBACK(Log_Popup_Menu_Handler), G_OBJECT(PopupMenu));
+    gtk_menu_attach_to_widget (GTK_MENU (PopupMenu), LogList, NULL);
+    g_signal_connect (G_OBJECT (LogList), "button-press-event",
+                      G_CALLBACK (Log_Popup_Menu_Handler), PopupMenu);
 
     // Load pending messages in the Log list
     Log_Print_Tmp_List();
@@ -173,7 +175,8 @@ GtkWidget *Create_Log_Area (void)
  * Log_Popup_Menu_Handler : displays the corresponding menu
  */
 static gboolean
-Log_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
+Log_Popup_Menu_Handler (GtkWidget *treeview, GdkEventButton *event,
+                        GtkMenu *menu)
 {
     if (event && (event->type==GDK_BUTTON_PRESS) && (event->button == 3))
     {
diff --git a/src/misc.c b/src/misc.c
index 6d6648e..62c5b61 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -3400,7 +3400,8 @@ Load_Filename_Set_Filenames (void)
  * Create and attach a popup menu on the two clist of the LoadFileWindow
  */
 static gboolean
-Load_Filename_Popup_Menu_Handler (GtkMenu *menu, GdkEventButton *event)
+Load_Filename_Popup_Menu_Handler (GtkWidget *treeview, GdkEventButton *event,
+                                  GtkMenu *menu)
 {
     if (event && (event->type==GDK_BUTTON_PRESS) && (event->button==3))
     {
@@ -3419,8 +3420,10 @@ Create_Load_Filename_Popup_Menu (GtkWidget *list)
 
 
     BrowserPopupMenu = gtk_menu_new();
-    g_signal_connect_swapped(G_OBJECT(list), "button_press_event", 
-                             G_CALLBACK(Load_Filename_Popup_Menu_Handler), G_OBJECT(BrowserPopupMenu));
+    gtk_menu_attach_to_widget (GTK_MENU (BrowserPopupMenu), list, NULL);
+    g_signal_connect (G_OBJECT (list), "button-press-event",
+                      G_CALLBACK (Load_Filename_Popup_Menu_Handler),
+                      BrowserPopupMenu);
     
     MenuItem = gtk_image_menu_item_new_with_label(_("Insert a blank line"));
     Image = gtk_image_new_from_stock(GTK_STOCK_ADD,GTK_ICON_SIZE_MENU);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]