Re: Detecting if GNOME is OK




Dave Gilbert <gilbertd@treblig.org> writes:

> Hi,
>   Hmm - the gtk_init_check stuff doesn't seem to be playing ball.
> The code I have is:
> 
> static int test()
> {
>   int argc=1;
>   char *argv[2];
> 
>   argv[0]="elvis";
>   argv[1]=NULL;
> 
>   gnomelib_init(PACKAGE,VERSION);
> 
> 
>   if (gtk_init_check(&argc,&argv)) return 1;
> 
>   return 0;
> } /* test */
> 
> ---------------------------------------------------
> 
> works fine if DISPLAY is set, but segs if it isn't or if it is set to a
> non-existant display:

Check your C: since argv is an array, &argv == argv. What you
want is:

 char *args[2];
 char **argv = args;

 args[0] = "elvis"
 args[1] = NULL; 

 gtk_init_check (&argc, &argv);

With that change, your code works fine for me. 

Regards,
                                        Owen



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