GNOME Bugzilla – Bug 590335
inadequate explanation of <menu> under <toolitem> in ui definition
Last modified: 2017-11-03 19:00:34 UTC
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." Correct version: I don't know. Is this possibility for real? If so, it should be properly documented; if not, these parts of the GtkUIManager doc should be removed. Other information: I tried strenuously to implement what seems to be implied by the quotations I have cited from the GtkUIManager docs, but nothing along these lines actually works.
Created attachment 139601 [details] Program to implement <menu> under <toolitem> Here's C code for a program which I believe ought to work according to the docs, but which does not work.
You need to implement a GtkAction derived class which sets GtkActionClass:toolbar_item_type to GTK_TYPE_MENU_TOOL_BUTTON in its class_init function, and use an instance of that for your IndexButton action.
OK, but in that case the GTK docs should state as much. As it is, the doc gives the impression that you can do <menu> under <toolitem> just using the regular GTK API, without going to the length of implementing your own sub-class of GtkAction.
GtkUIManager and GtkAction are deprecated in GTK+ 3, and are already removed in GTK+ 3.9x. So at this point it is not worth improving that part of the documentation.