(GnomeReplyCallback)on_DruidButtonOK_clicked_dialog_callback,
&reply); /* data */
g_signal_connect((gpointer)dialog,"close",G_CALLBACK(gtk_main_quit),NULL);
+ /* Never call gtk_main() from other thread than the initial one.
+ * We would have to switch GTK+ context (g_main_context()?).
+ */
gtk_main();
/* 'dialog' gets destroyed automatically */
if (reply==0) /* 0 for 'OK', 1 for 'Cancel', left -1 for dialog close. */
GtkCellRenderer *cell;
GtkBox *druid_button_box;
+ gdk_threads_enter();
+
App=GNOME_APP(create_App());
DriversTreeView=GTK_TREE_VIEW(lookup_widget(GTK_WIDGET(App),"DriversTreeView"));
NULL); /* callback_data */
state_changed();
+
+ gdk_threads_leave();
}
static void ui_gnome_g_log_handler(const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,gpointer user_data)
static void ui_gnome_interactive(void)
{
- gtk_widget_show_all(GTK_WIDGET(App));
+ gdk_threads_enter();
- if (!g_thread_supported())
- g_thread_init(NULL);
- if (!gdk_threads_mutex)
- gdk_threads_init();
+ gtk_widget_show_all(GTK_WIDGET(App));
- gdk_threads_enter();
gtk_main();
+
gdk_threads_leave();
+
exit(EXIT_SUCCESS);
}
ui_interactive=ui_gnome_interactive;
captivemodid_module_best_priority_notify=ui_gnome_module_best_priority_notify;
+ /* gdk_threads_init() must be called before gtk_init()!
+ * gtk_init() gets called by create_App() here.
+ */
+ if (!g_thread_supported())
+ g_thread_init(NULL);
+ if (!gdk_threads_mutex)
+ gdk_threads_init();
+
/* Graphic widgets will all be hidden yet. */
App_init();
/* ui_gnome_g_log_handler() needs 'App'. */