Re: Stock Items Deprecation

On 07/17/13 12:21, Emmanuele Bassi wrote:

On 17 July 2013 11:01, Jean Brefort <jean brefort normalesup org> wrote:
Le mercredi 17 juillet 2013 à 11:47 +0200, Murray Cumming a écrit :
On Tue, 2013-07-02 at 09:41 -0400, William Jon McCann wrote:

As some of you may have noticed we have recently deprecated Stock
Items in master.

Some details on this change may be found here:

Please let us know what you think.

This deprecated several classes (GtkIconFactory, GtkIconSet,
GtkIconSource, GtkImageMenuItem, GtkAction, GtkUIManager).

for GtkUIManager we already have a replacement that covers about 95%
of the use cases: GtkBuilder.

GAction replaces GtkAction; images on menus have been discouraged for
years, and the whole menu system has been replaced by GMenu XML
descriptions that can be exported on the session bus.

named icons have been replacing stock items for years; API is
available both in GTK (GtkIconTheme) and in GIO (GIcon, GThemedIcon,

So since this started I've been looking at not using stock items
anymore, and have been using GtkIconTheme instead[1]. However, one thing
stock items also did that seems to be missing now (unless I'm missing
something, which is possible), is handle different sort of rendering
based on widget states, e.g. when disabled/not sensitive, the icon would
reflect that "automatically."

How should this be handled now? If one doesn't use stock items, but
wants to use icons in a menu (or button), and have the icon shown as
"disabled" when the widget isn't sensitive, what's the recommended way
to do it ?


[1] Specifically, using gtk_icon_theme_load_icon() to get a GdkPixbuf.

All these? And what replace them?

you should have read the thread and the document linked at the start of it.

Should I just stop using gtk+ for
development? I have not so much available time and rewriting code using
deprecated classes should not use it all. I clearly prefer spend time on
new code, or fixing bugs.

you can still use deprecated classes until we break GTK for 4.0.
deprecation does not mean removal, it just means that the deprecated
API should not ("should not", not "must not") be used in newly written


gtk-devel-list mailing list
gtk-devel-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]