[Glade-users] practical question: apps locating glade file

Tommi Komulainen tommi.komulainen@nokia.com
Tue, 07 Dec 2004 18:54:49 +0200


On Thu, 2004-12-02 at 00:31 -0700, ext Neil Zanella wrote:

> Right now I hardcode the location of the glade file in a veriable.
> This could be a
> relative path, so I could have ../share/fooapp/foo.glade as the relative path?
> That way I can keep a similar directory structure in my tarball and test before
> install in this way? How do most people do it?

In Galeon we do things roughly as follows:

#ifdef ENABLE_MAINTAINER_MODE
   /* for running inside the toplevel directory (./src/galeon) */
   gladexml = glade_xml_new ("./ui/galeon.glade", ...);
   /* for running in src/ subdirectory (./galeon) */
   if (!gladexml)
     gladexl = glade_xml_new ("../ui/galeon.glade", ...);
#endif
   if (!gladexml)
     gladexl = glade_xml_new (GLADEDIR "/galeon.glade", ...);


Basically you just iterate through a set valid directories, and use the
first file you can find.  Naturally it's probably best to have a nice
helper function do the hard work so that it doesn't need to be
replicated.


-- 
Tommi Komulainen                            <tommi.komulainen@nokia.com>