multi thread pb



Hi,
        I wrote an application that uses pthread. The main function looks
like :


g_thread_init(NULL);
gnome_init( PACKAGE, VERSION, argc, argv );
gdk_threads_enter();
gtk_main();
gdk_threads_leave();


        But when i try to invoke a dialog box in another thread the app
crashes :

gdk_threads_enter();
GtkWidget *dlg = gnome_message_box_new( "Some error message",
GNOME_MESSAGE_BOX_WARNING, GNOME_STOCK_BUTTON_OK, NULL );
gnome_dialog_run( GNOME_DIALOG(dlg) );
gdk_threads_leave();


And i got this :
GLib-WARNING **: g_main_iterate(): main loop already active in another
thread

Have any idea ?


Vincent.




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