[GNC-dev] warning: 'gtk_action_set_sensitive' is deprecated [-Wdeprecated-declarations] And gtk4

john jralls at ceridwen.us
Wed Oct 6 12:02:13 EDT 2021



> On Oct 5, 2021, at 9:54 PM, Chris Good <goodchris96 at gmail.com> wrote:
> 
> Hi John Ralls,
> 
> 
> 
> I'm following up on the your suggestion that it should not be possible to
> start another import while another is already running.
> 
> 
> 
> When I added gtk_action_set_sensitive() the compiler says:
> 
> /home/cgood/gnucash-maint/src/gnucash/import-export/ofx/gnc-plugin-ofx.c:121
> :5: warning: 'gtk_action_set_sensitive' is
> 
> deprecated [-Wdeprecated-declarations]
> 
> 
> 
> but I see in maint, that function is used in many places but with
> 
> -Wno-deprecated-declarations
> 
> in the CMakeLists.txts to ignore this warning.
> 
> 
> 
> https://docs.gtk.org/gtk3/class.Action.html :
> 
>                 In GTK+ 3.10, GtkAction has been deprecated. Use GAction
> instead, and associate actions with GtkActionable widgets.
> 
>                  Use GMenuModel for creating menus with
> gtk_menu_new_from_model().
> 
> 
> 
> There are NO mentions of GMenuModel in current maint or master.
> 
> 
> 
> Should I just continue with gtk_action_set_sensitive and add
> -Wno-deprecated-declarations to CMakeLists.txt?
> 
> 
> 
> Is there a plan to migrate to GAction? Is that going to be a huge task?
> 
> 
> 
> I haven't seen any discussion about going to gtk4. Is that not a huge task
> like gtk2 to gtk3?

Nobody's told me of undertaking the effort to rework the GUI for Gtk4, and I think Geert is somewhat opposed to it because we want to consider converting to another graphics framework at some point. There's no need to rush, Gtk3 will continue in maintenance mode for several more years. Consider that The GIMP (which is the "G" in Gtk) is still working on their Gtk3 conversion.

IMO it would be far more useful to work on MVC separation in the GUI directories than on modernizing GtkActionGroup and GtkMenu usage.

We don't want no-deprecated-declarations, that might silence something from another library that we'd need to know about. I think there's a Gtk or Glib macro to silence those particular deprecation warnings.

Regards,
John Ralls




More information about the gnucash-devel mailing list