Re: GtkStockIcon and GtkIconFactory



Havoc Pennington <hp redhat com> writes:

> To add a new icon in your application, the steps are something like:
> 
>  - create an icon factory for your application
>  - call gtk_icon_factory_add_default() to add your icon factory 
>    to the search path
>  - for each icon you want to add, create an icon set, and call
>    gtk_icon_set_add_source() to add sources to the icon set
>    (usually only one source), then add the icon set to the 
>    icon factory with gtk_icon_factory_add()
> 
> Typically, you want to use inline pixbufs for these icons, as in
> gtkiconfactory.c.
> 
> Then themes can override your icons by specifying gtkrc entries.
> 
> Be sure to namespace your stock ID's, e.g. "gtk-open," or
> "nautilus-foobar," because themes may want to ship icons for lots of
> different apps.

How does this API handle different sets of icon sizes ?

I mean, currently there is GTK_ICON_SIZE_*, but the actual size is
hard-coded in gtkiconfactory.c.

However, I think sometimes it is desirable for a theme to override all
the sizes - for instance when you want to have a theme with very big icons,
it looks much better if the theme provides the big icons rather than scaling
the small ones.

-- 
Martin Baulig
martin gnome org (private)
baulig suse de (work)




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