Using pixmap files in Gnome apps




I'm trying to figure out a decent way to use pixmap files in Gnome apps.

If you specify pixmap filenames in GnomeUIInfo structs or in calls like
gnome_about_new(), then gnome_pixmap_file() in libgnome/gnome-util.c
is used to try to find the pixmap file.

gnome_pixmap_file() will try appending the relative filename to:

  $GNOMEDIR/share/pixmaps/
  $HOME/share/pixmaps/
  GNOMEDATADIR/pixmaps/
  ./

This may be OK for installed apps (though forcing people to install pixmaps
into GNOMEDATADIR/pixmaps isn't ideal, as it screws up the normal 'prefix'
stuff). But it doesn't seem to be very good for uninstalled apps (unless
you happen to keep all pixmaps in the same directory as the executable).

I think adding something like a "pixmap path" with functions like 
gnome_add_pixmap_dir() may be better for 1.1.

But what do I do for now? Force people to install apps before running them?
I don't think that's very good.

One possible workaround is for the app to cd into the uninstalled pixmaps
directory before creating the interface, so the last "./" test will find
the pixmaps. But that won't work if I intend to use an app-specific
subdirectory of GNOMEDATADIR/pixmaps.

Any better ideas?

Also, should all apps be dumping their pixmaps into the same directory?
That's probably not a very good idea.

Damon




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