Re: gtk threads



you need to initialize the gdk threads:

int main( int argc, char *argv[] )
{
   g_thread_init(NULL);
   gdk_threads_init();
   gtk_init(&argc,&argv);
...

   gdk_threads_enter();
   gtk_main();
   gdk_threads_leave();
}

Russell Shaw wrote:

Hi,
This test prog counts to 20 on the terminal window and should show
a GtkLabel "test" displayed in a GtkWindow.

With the thread code commented out as below, "test" is shown correct.
When the thread is allowed to run, the label is not shown. Why so?

Snip





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