GNOME Bugzilla – Bug 752093
Improvement to GtkImageMenuItem long description and code snippet
Last modified: 2015-07-08 17:53:26 UTC
Created attachment 307029 [details] [review] Improved description and code snippet for GtkImageMenuItem.c Since GtkImageMenuItem is deprecated, the documentation page provides an example code snippet that demonstrates how to produce the equivalent functionality using a GtkMenuItem. I discovered, however, that when you create a keyboard accelerator and try to attach it to a custom GtkMenuItem (containing a box as a child), the currently provided code snippet fails. In order to correctly attach a keyboard accelerator, you have to use gtk_box_pack_end(), in addition to aligning the label. An good example of this can be found here (lines 81-94): https://git.gnome.org/browse/gtk+/tree/tests/teststockbuttonmenu.c Since gtk_image_menu_item_new_with_label() is commonly used, I think it is valuable to explain the equivalent functionality using GtkMenuItem. I have attached a proposed patch to the documentation that includes a short explanatory paragraph and an additional updated snippet.
thanks, thats useful information to add