gtk 2 program icon question

Stuart Jansen sjansen at buscaluz.org
Sun Sep 19 23:46:39 MDT 2010


On Sun, 2010-09-19 at 22:53 -0600, Charles Curley wrote:
> I'd like to set the program icon for a gtk 2 application written in C.
> To do this, I know to use gtk_window_set_icon (). It takes a GDK
> pixbuf. I can create a pixbuf from an external file using
> gdk_pixbuf_new_from_file, but that's a bit tacky. I'd rather compile it
> into the program. Supposedly you can do it, but how?


http://library.gnome.org/devel/gdk-pixbuf/stable/gdk-pixbuf-creating.html#gdk-pixbuf-new-from-xpm-data

or

http://library.gnome.org/devel/gdk-pixbuf/stable/gdk-pixbuf-creating.html#gdk-pixbuf-new-from-inline

I like to use XPM because many image programs know how to work with it.
For example, both the gimp and eog support XPM files.

An XPM file is basically just a C header file, so it's not the most
efficient format, but for icons that's not a big deal.

-- 
Stuart Jansen <sjansen at buscaluz.org>



More information about the PLUG mailing list