Re: gtk_file_selection_new() problem




John Looney <John.Looney@hos.horizon.ie> writes:

> I have been running with 1.0.3 for a while in work (on solaris). I
> downloaded 1.0.4, and brought it home to my linux box. I compiled up some
> code I had working with 1.0.3, and for some reason it crashed. 
> 
>  I did some investigating, and it's crashing while trying to call
> XQueryFont, with gdk_display still set to NULL. It did this all the time,
> even in such a program:
> 
> 
> #include <gtk/gtk.h>
> 
> int main(int argc, char *argv[])
> {
>    GtkWidget *file_sel;
>    gtk_file_selection_new("Hello");
>    printf("Got to here\n");
> 
> }
>  
>  It didn't even print out the "Got to here" - it just used up all my swap,
> and the machine died. Most annoying. Am I doing something funny, or is it
> something known ?

You must always call gtk_init(&argc, &argv) before any other GTK 
functions.

[ 
 To qualify this a bit:

 - If you want to use the object system, but not widgets, you
   can do this by calling gtk_signal_init() and gtk_type_init()
    separately.

 - gtk_set_locale(), when used, should be called before 
   gtk_init()
]

Regards,
                                        Owen
 



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