After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653457 - Express toolbar menus via GtkAction/UIManager
Express toolbar menus via GtkAction/UIManager
Status: RESOLVED FIXED
Product: gedit-latex
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: José Aliste
Gedit maintainers
Depends on: 653303
Blocks:
 
 
Reported: 2011-06-27 00:06 UTC by John Stowers
Modified: 2019-02-22 03:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John Stowers 2011-06-27 00:06:50 UTC
This is a limitation in pygobject/gtk - oolbars with menus via gtkuimanager are impossible without a custom action subclass

https://bugzilla.gnome.org/show_bug.cgi?id=653303
Comment 1 John Stowers 2011-06-27 06:20:28 UTC
I might be able to work around this using connect proxy, something like

        self.ui_manager = gtk.UIManager()
        self.ui_manager.insert_action_group(self.action_group, 1)
        self.ui_manager.add_ui_from_file(os.path.join(const.UI_DIR, 'pygoscelis.ui'))
        self.add_accel_group(self.ui_manager.get_accel_group())
        self.menubar = self.ui_manager.get_widget('/main-menu')
        self.toolbar = self.ui_manager.get_widget('/main-toolbar')
        self.toolbar.set_style(gtk.TOOLBAR_ICONS)
  
        self.back_toolitem = gtk.MenuToolButton(gtk.STOCK_GO_BACK)
        self.forward_toolitem = gtk.MenuToolButton(gtk.STOCK_GO_FORWARD)
  
        self.action_group.get_action("go-forward").connect_proxy(self.forward_toolitem)
        self.action_group.get_action("go-back").connect_proxy(self.back_toolitem)
        self.toolbar.insert(self.forward_toolitem, 0)
        self.toolbar.insert(self.back_toolitem, 0)
Comment 2 José Aliste 2011-06-28 02:44:39 UTC
John, thanks for looking into this. Actually, there is an easier way to do it, as we can just overload create_tool_item.