This fixes a deprecation warning in the lipsum plugin for gtk3. No functional changes. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/856
-- Commit Summary --
* lipsum: fixed deprecated gtk call for gtk3
-- File Changes --
M build/lipsum.m4 (2) M lipsum/src/Makefile.am (5) M lipsum/src/lipsum.c (1) M utils/src/gp_gtkcompat.h (8)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/856.patch https://github.com/geany/geany-plugins/pull/856.diff
codebrainz commented on this pull request.
@@ -51,6 +51,14 @@ G_BEGIN_DECLS
#define GTK_STOCK_OPEN _("_Open") #define GTK_STOCK_CANCEL _("_Cancel") #endif + +/* Replace calls to gtk_image_menu_item_new_with_mnemonic() with call to + gtk_menu_item_new_with_mnemonic(). Starting from version 3.10.*/ +#if GTK_CHECK_VERSION(3, 10, 0) +#define gtk_image_menu_item_new_with_mnemonic(icon_info) \ + gtk_menu_item_new_with_mnemonic(icon_info)
This doesn't seem like a good wrapper for general use in the util library since it returns a different type of widget.
While much more work, it might be better to add some kind of real image menu item replacement class that packs an optional icon and an accel label into a box, similar to the example on the [GtkImageMenuItem docs](https://developer.gnome.org/gtk3/stable/GtkImageMenuItem.html).
LarsGit223 commented on this pull request.
@@ -51,6 +51,14 @@ G_BEGIN_DECLS
#define GTK_STOCK_OPEN _("_Open") #define GTK_STOCK_CANCEL _("_Cancel") #endif + +/* Replace calls to gtk_image_menu_item_new_with_mnemonic() with call to + gtk_menu_item_new_with_mnemonic(). Starting from version 3.10.*/ +#if GTK_CHECK_VERSION(3, 10, 0) +#define gtk_image_menu_item_new_with_mnemonic(icon_info) \ + gtk_menu_item_new_with_mnemonic(icon_info)
Thanks. But I guess I will then postpone that to a later time when it's really required. Here with lipsum there is no icon used at all. I will do the replacement in the lipsum file directly and remove the macro. If I find a use case later which really uses an icon I will go for your advice.
@LarsGit223 pushed 1 commit.
59004f082fb26935e7e1a7c8bb73d91ab633882c lipsum: fix it locally
LarsGit223 commented on this pull request.
@@ -51,6 +51,14 @@ G_BEGIN_DECLS
#define GTK_STOCK_OPEN _("_Open") #define GTK_STOCK_CANCEL _("_Cancel") #endif + +/* Replace calls to gtk_image_menu_item_new_with_mnemonic() with call to + gtk_menu_item_new_with_mnemonic(). Starting from version 3.10.*/ +#if GTK_CHECK_VERSION(3, 10, 0) +#define gtk_image_menu_item_new_with_mnemonic(icon_info) \ + gtk_menu_item_new_with_mnemonic(icon_info)
Done.
Merged #856 into master.
github-comments@lists.geany.org