GNOME Bugzilla – Bug 653303
Add gtk_action_set_tool_item_type
Last modified: 2011-06-28 02:47:03 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?
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()