Re: loading pixmaps from the C source



2008/10/22 Henri Häkkinen <henrih81 gmail com>

Hello,

I am writing a simple GTK+ 2.0 application which uses the GNU build system.
The application opens a status icon on the system tray area and the icon is
loaded from a image file. By default, the icon gets installed to the usual
location (/usr/local/$PACKAGE/pixmaps), but the user may choose to install
the package to some other place by using --prefix etc. configure script
options.

What is the correct way of opening image files from the C source then? How
do I know where the look for the installed data files?


I do this myself by getting the specified install path in the Makefile.am
file as #defines and using the path in the C code. For example see
http://svn.gnome.org/viewvc/libgnomedb/trunk/extra/Makefile.am?view=log

Also I've found that this method has its limit if the user actually installs
or copies the compiled version somewhere else, or if you want to compile for
Windows or Mac OS, in which case you can use a "binreloc" layer. For example
see http://svn.gnome.org/viewvc/libgnomedb/trunk/libgnomedb/binreloc/.

Regards,

Vivien




--
Henri Häkkinen
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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