+static void
+widget_deleter (GtkWidget *widget, gpointer data)
+{
+ /* #### Well, I want to destroy these widgets, but if I do that, they get
+ referenced again, and eventually I get a SEGV. So instead of
+ destroying them, I'll just hide them, and leak a bunch of memory
+ every time the disk file changes. Go go go Gtk!
+
+ #### Ok, that's a lie, I get a crash even if I just hide the widget
+ and don't ever delete it. Fuck!
+ */
+#if 0
+ gtk_widget_destroy (widget);
+#else
+ gtk_widget_hide (widget);
+#endif
+}
+
+
+static int
+maybe_reload_init_file (GtkWidget *widget, prefs_pair *pair)
+{
+ int status = 0;
+ saver_preferences *p = pair->a;
+
+ static Bool reentrant_lock = False;
+ if (reentrant_lock) return 0;
+ reentrant_lock = True;
+
+ if (init_file_changed_p (p))
+ {
+ const char *f = init_file_name();
+ char *b;
+ int which;
+ GtkList *list;
+
+ if (!f || !*f) return 0;
+ b = (char *) malloc (strlen(f) + 1024);
+ sprintf (b,
+ "Warning:\n\n"
+ "file \"%s\" has changed, reloading.\n",
+ f);
+ warning_dialog (widget, b, 100);
+ free (b);
+
+ load_init_file (p);
+
+ which = selected_hack_number (widget);
+ list = GTK_LIST (name_to_widget (widget, "list"));
+ gtk_container_foreach (GTK_CONTAINER (list), widget_deleter, NULL);
+ populate_hack_list (widget, pair);
+ gtk_list_select_item (list, which);
+ populate_prefs_page (widget, pair);
+ populate_demo_window (widget, which, pair);
+ ensure_selected_item_visible (GTK_WIDGET (list));
+
+ status = 1;
+ }
+
+ reentrant_lock = False;
+ return status;
+}
+