[Users] [GTK3] What to do about GtkStock and GTK_STOCK_YES?

Rob Hoelz rob at hoelz.ro
Sun Jan 7 23:05:57 CET 2018


Hi claws-mail devs,

When I was working on getting Claws Mail 3.16 to compile against GTK3, one of the most common errors I found was with code like this:

> "+" GTK_STOCK_YES

It appears that pre-GTK3, GTK_STOCK_YES and co. were simply string constants, so this would just prepend a plus character to that string,
which Claws Mail uses in alertpane_create to set up some custom behavior for the corresponding labels.

In GTK3, however, those constants are GtkStock* (just casted from string constants, but this still makes the compiler unhappy).  In my patch,
I just expanded GTK_STOCK_YES and co. to the underlying string constant where needed to get claws to compile.  Obviously this isn't really viable
going forward, so I was wondering how this change should be made instead.  Should we set up our own CM_STOCK_* constants?

-Rob



More information about the Users mailing list