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

Geert Janssens geert.gnucash at kobaltwit.be
Wed Oct 6 13:06:21 EDT 2021


Op woensdag 6 oktober 2021 18:02:13 CEST schreef john:
> > 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:1
> > 21> 
> > :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.

I'm not really opposed though I *am* indeed also interested in shopping for 
other frameworks. I think switching to Gtk4 may be less work that fully 
replacing with another framework and hence may be a more achievable goal.

GtkActions have been deprecated for a while and it may also be a useful effort 
to convert those to GActions. IIRC we looked at this quite a while ago and it 
turned out to be not that simple as it required changes from GtkMenus to 
GMenus and that hooks into GApplication which we also don't use. (All from 
memory so this may not be fully accurate)


> 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.
> 
That I agree to as well. The only thing tempting me to Gtk4 is it's rumored to 
have a much more performant replacement for GtkTreeView which may allow us to 
do a better register (as in more Gtk conforming and standard widget based) 
than we have now. I haven't investigated this at all, it just something I 
gathered  from cursory reading news around Gtk4.

> IMO it would be far more useful to work on MVC separation in the GUI
> directories than on modernizing GtkActionGroup and GtkMenu usage.
> 
MVC separation is definitely also very much needed and might even be a 
prerequisite to do the GAction/GMenu/GApplicatation work.

Regards,

Geert




More information about the gnucash-devel mailing list