Re: Can the list of stock icons be extended?



Skip Montanaro <skip pobox com> writes:
> (I'm using the 2.0 API.)
> 
> Can the list of stock icons be extended?  For example, Gtk doesn't provide a
> "new folder" stock icon.  I'd like to be able to have this in a resource
> file

Sure, this can be done. There's an example in gtk-demo, for the "main
application window" demo, the GTK+ logo button in the toolbar is done
as a custom stock icon. It can be themed from gtkrc.

> 
>     pixmap_path "/full/path/to/my/xpm/files"
> 
>     style "icons" {
>         stock["new-folder"] = {

When you do this, suggest including your application namespace, just
as GTK uses its namespace. e.g. we have gtk-ok, gtk-cancel, etc. If
you use your app namespace, then themes can include support for
various apps without getting collisions.

The exact rc file format is documented in the API reference, under
the docs for GtkRcStyle IIRC.

Havoc



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