Thread and create window



Hi,

I have read some FAQ to create a window with an other
thread and I don't understand this problem:

int main(int argc, char* argv[])
{
  poptContext pctx;

  g_thread_init(NULL);

  gnome_init_with_popt_table(PACKAGE, VERSION, argc,
argv, options, 0, &pctx);

  app = avm_app_new();
  gtk_widget_show_all(app);

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

  return 0;
}

And In a thread created in avm_app_new();
void *ReadCom(void *arg)
{
...
  gdk_threads_enter();
  gtk_widget_show_all(dialog);				
  gdk_threads_leave();
}
First my window appear but I must move my mouse or
press a key..

Then In my project I have the error :

GLib-WARNING**:g_main_iterate(): main loop already
active in another thread

What is bad???

=====
oO0 A + Ju 0Oo

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com



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