Fix popup menus in drop-down navigation sidebar

This commit is contained in:
Nick Hall 2014-04-15 22:37:50 +01:00
parent c7e160436a
commit 4e239310a1

View File

@ -122,7 +122,7 @@ class DropdownSidebar(BaseSidebar):
""" """
Called when a view drop-down arrow is clicked. Called when a view drop-down arrow is clicked.
""" """
menu = Gtk.Menu() self.menu = Gtk.Menu()
for item in self.views[cat_num]: for item in self.views[cat_num]:
menuitem = Gtk.ImageMenuItem(label=item[1]) menuitem = Gtk.ImageMenuItem(label=item[1])
image = Gtk.Image.new_from_stock(item[2], Gtk.IconSize.MENU) image = Gtk.Image.new_from_stock(item[2], Gtk.IconSize.MENU)
@ -130,8 +130,8 @@ class DropdownSidebar(BaseSidebar):
menuitem.set_image(image) menuitem.set_image(image)
menuitem.connect("activate", self.cb_menu_clicked, cat_num, item[0]) menuitem.connect("activate", self.cb_menu_clicked, cat_num, item[0])
menuitem.show() menuitem.show()
menu.append(menuitem) self.menu.append(menuitem)
menu.popup(None, None, cb_menu_position, button, 0, 0) self.menu.popup(None, None, cb_menu_position, button, 0, 0)
def cb_menu_clicked(self, menuitem, cat_num, view_num): def cb_menu_clicked(self, menuitem, cat_num, view_num):
""" """