Multithreading and dialog boxes



Hi,

(Gtk2) Whenever I run a dialog box from inside a thread, the dialog box
never gets destroyed, and it hangs my application:

void dialog (void) {
	GtkWidget *dialog;

	gdk_threads_enter();

	dialog = gtk_message_dialog_new(NULL,
					GTK_DIALOG_DESTROY_WITH_PARENT,
					GTK_MESSAGE_WARNING,
					GTK_BUTTONS_OK,
					"Sample message");

	gtk_dialog_run(GTK_DIALOG(dialog));
	gtk_widget_destroy(dialog);

	gdk_threads_leave();
}

It works fine when called within the main thread, btw.

Any clue?

Regards,
Jean-Yves Lefort

-- 
Jean-Yves Lefort

jylefort brutele be
http://void.adminz.be/



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