Re: can't create and show GtkWidget in thread



Hi,

Paul Davis <pbd Op Net> writes:

> >in thread, can I? Is the gtk_widget_show a GTK+ functions? thanks
> 
> "GTK+" functions are named "gtk_something".
> 
> If its called 
> 
>    gtk_*
>    gdk_*
>    g_*
> 
> then you should consider it necessary to surround the calls to it/them
> with a lock acquisition and release. i'm not totally sure about the
> g_* functions, but i think this is true even there.

not true for glib functions. Actually you only need to guard functions
that call GDK functions. If you are not sure, you are on the safe side 
by obtaining the lock for all gtk_* and gdk_* called from your threads.

glib itself is thread-safe, but of course you need to locking if two
threads access the same data structures (a GHashTable for example).


Salut, Sven




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