From fd13311aa0ef8fd361a7442a6e121cda01aa3e50 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 26 Dec 2012 22:15:03 +0000 Subject: [PATCH] 1. context menu on displaytabs showing 2. partially do bug 1772 svn: r20842 --- gramps/gui/editors/displaytabs/embeddedlist.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gramps/gui/editors/displaytabs/embeddedlist.py b/gramps/gui/editors/displaytabs/embeddedlist.py index 52a6000aa..49b85075a 100644 --- a/gramps/gui/editors/displaytabs/embeddedlist.py +++ b/gramps/gui/editors/displaytabs/embeddedlist.py @@ -104,9 +104,9 @@ class EmbeddedList(ButtonTab): Handle button press, not double-click, that is done in init_interface """ if is_right_click(event): - ref = self.get_selected() - if ref: - self.right_click(obj, event) + #ref = self.get_selected() + #if ref: + self.right_click(obj, event) elif event.type == Gdk.EventType.BUTTON_PRESS and event.button == 2: fun = self.get_middle_click() if fun: @@ -146,20 +146,18 @@ class EmbeddedList(ButtonTab): On right click show a popup menu. This is populated with get_popup_menu_items """ - menu = Gtk.Menu() + self.__store_menu = Gtk.Menu() #need to keep reference or menu disappears + menu = self.__store_menu for (needs_write_access, image, title, func) in self.get_popup_menu_items(): if image: if isinstance(title, tuple): img_stock, txt = title - item = Gtk.ImageMenuItem(txt) + item = Gtk.ImageMenuItem.new_from_label(txt) img = Gtk.Image() img.set_from_stock(img_stock, Gtk.IconSize.MENU) item.set_image(img) else: - item = Gtk.ImageMenuItem('') - img = Gtk.Image() - img.set_from_stock(title, Gtk.IconSize.MENU) - item.set_image(img) + item = Gtk.ImageMenuItem.new_from_stock(title, None) else: item = Gtk.MenuItem(label=title) item.connect('activate', func)