[Patch] Add xfce_image_menu_item_new to libxfce4ui

Florian Weigelt weigelt.florian at gmx.net
Sat Feb 4 02:55:06 CET 2017


Please find attached a patch which adds some functionality to libxfce4ui
to use a GtkMenuItem with an icon without using the (in gtk3) deprecated
GtkImageMenuItem.
The code is based on the example given here:
https://developer.gnome.org/gtk3/stable/GtkImageMenuItem.html

This function is not intended to be used for creating menu bars. Using
GtkBuilder with GMenu (which actually has an icon property) is by far
better suited for this purpose.
However, applications like xfdesktop and xfce4-panel also use
GtkImageMenuItem's and it would be nice to offer the same functionality
in a gtk3 port of these applications.

I decided on those three parameters because those were the three
information usually available when I looked at xfdesktop's sources. It
is also possible to let the user create a GtkLabel first and pass this
widget to the function.
It would also be possible to exclude this function entirely from the
gtk2 build of libxfce4ui where GtkImageMenuItems weren't deprecated.
Please share your thoughts on this.

Kind regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libxfce4ui-add-imagemenuitem.patch
Type: text/x-diff
Size: 3169 bytes
Desc: not available
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20170204/1b476f45/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20170204/1b476f45/attachment.sig>


More information about the Xfce4-dev mailing list