Re: Detecting if GNOME is OK



On Sun, 19 Mar 2000, Dave Gilbert wrote:

> Ive tried gnome_init and then gnome_app_new, but gnome_init seems to fail
> and exit the program rather than return an error flag.

Here's what I did in RadioActive: first you call gnomelib_init () to be
able to use gnome_config etc, and then check for the DISPLAY environmental
variable, and use either libgnomeui or some text-mode stuff to do your UI:

<wavy transition to sample code />

    gnomelib_init(PROGNAME, VERSION);
    
    // Load configuration
    read_config();

    // User interface
    if (getenv("DISPLAY"))
    {
	Gnome::Main m = new Gnome::Main(PROGNAME, VERSION, 1, arg_dummy);
	// ...
    } else {
	// ...
    }

-- 
   .--= ULLA! =----------------------------.  finger cactus@cactus.rulez.org
   \      http://cactus.rulez.org           \   for PGP public key
    `----------= cactus@cactus.rulez.org =--'
It is a rather pleasant experience to be alone in a bank at night.



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