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 653303 - Add gtk_action_set_tool_item_type
Add gtk_action_set_tool_item_type
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Widget: Other
3.0.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 590335
Blocks: 653457
 
 
Reported: 2011-06-24 03:04 UTC by John Stowers
Modified: 2011-06-28 02:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John Stowers 2011-06-24 03:04:47 UTC
+++ This bug was initially created as a clone of Bug #590335 +++

Im trying to add a submenu in a GtkUIManager defined toolbar.
 
Documentation 
Section: gtk-doc/html/gtk/GtkUIManager.html
"<!ELEMENT toolitem     (menu?) >"

"Note that toolitem elements may contain a menu element, but only if their associated action specifies a GtkMenuToolButton as proxy."

So one has to create a derived action and set this in the class. This is not easily possible for introspected languages or those using gobject-introspection.

I need this in PyGObject.

PyGtk had a custom menthod that did

    klass = (GtkActionClass *) g_type_class_ref(gtype);
    klass->toolbar_item_type = tool_item_type;
    g_type_class_unref(klass);

Can something be added to GtkAction so I can achieve the same thing?
Comment 1 José Aliste 2011-06-28 02:47:03 UTC
So there is another way to do that, just overload the create_tool_item method from the GtkActionClass, i.e., just do something like 

class CustomAction(Gtk.Action):

  __gtype_name__ = "CustomActionType"

  def do_create_tool_item(self):
    return CustomWidget()