From 3147cf5a2b2db3582734ac71a4319ef9e32002f6 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 17 Apr 2015 15:11:08 -0700 Subject: [PATCH] Fix gtk-critical error when setting mac menubar. --- gramps/gui/viewmanager.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 38a977442..e063dc968 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -380,7 +380,7 @@ class ViewManager(CLIManager): hpane.add2(self.notebook) self.menubar = self.uimanager.get_widget('/MenuBar') self.toolbar = self.uimanager.get_widget('/ToolBar') - vbox.pack_start(self.menubar, False, True, 0) + self.__attach_menubar(vbox) vbox.pack_start(self.toolbar, False, True, 0) vbox.pack_start(hpane, True, True, 0) self.statusbar = Statusbar() @@ -828,13 +828,15 @@ class ViewManager(CLIManager): self.uimanager.add_ui_from_string(UIDEFAULT) self.uimanager.ensure_update() + + def __attach_menubar(self, vbox): + vbox.pack_start(self.menubar, False, True, 0) if _GTKOSXAPPLICATION: - menubar = self.uimanager.get_widget("/MenuBar") - menubar.hide() + self.menubar.hide() quit_item = self.uimanager.get_widget("/MenuBar/FileMenu/Quit") about_item = self.uimanager.get_widget("/MenuBar/HelpMenu/About") prefs_item = self.uimanager.get_widget("/MenuBar/EditMenu/Preferences") - self.macapp.set_menu_bar(menubar) + self.macapp.set_menu_bar(self.menubar) self.macapp.insert_app_menu_item(about_item, 0) self.macapp.insert_app_menu_item(prefs_item, 1)