Re: How to determine the gnome environment



On Thu, Sep 26, 2002 at 06:46:48PM +0800, Yuedong Du wrote:
> Who know how determine if the user is using gnome 2 environment ?
> I want to integrate a application into gnome, but how can I know gnome 
> exist on user's machine?

This is becoming an FAQ.

What you need to do is work out which libraries in the GNOME hierarchy
you rely on and test for those. As a general rule, testing if they have
libgnomeui-2.0 available should be sufficient (since that requires
libbonobo, libgnome, gtk+, atk, pango, ....).

You will need to test that pkg-config is available and then use
pkg-config tests to see if libgnomeui-2.0 (or whatever else you want) is
available. Have a look at the configure.in files from a few standard
GNOME applications (things like gnome-utils or gedit or Nautilus).

> Just see if /usr/gnome exist is enough?

Definitely not. You cannot make any assumptions about how the user has
laid out their installation. That is why pkg-config exists, for example;
to provide you with the information required to build on each particular
system.

Cheers,
Malcolm



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