gtk_widget_destroy (dialog);
}
-void
-connect_help (GladeXML *xml)
+static void
+connect_help_builder (GtkBuilder *xml)
+{
+ GSList *helps = gtk_builder_get_objects (xml);
+
+ GSList *i;
+ for ( i = helps; i ; i = g_slist_next (i))
+ {
+ GObject *o = i->data;
+ if ( GTK_IS_WIDGET (o) )
+ {
+ gchar *name = NULL;
+ gchar s[12] = {0};
+ g_object_get (o, "name", &name, NULL);
+
+ if ( name)
+ strncpy (s, name, 11);
+ s[11] = '\0';
+
+
+ if ( 0 == strcmp ("help_button", s))
+ {
+ g_signal_connect (GTK_WIDGET (o), "clicked", give_help, 0);
+ }
+ }
+ }
+
+ g_slist_free (helps);
+}
+
+static void
+connect_help_glade (GladeXML *xml)
{
GList *helps = glade_xml_get_widget_prefix (xml, "help_button_");
}
+void
+connect_help (gpointer *xml)
+{
+ if (GTK_IS_BUILDER (xml))
+ connect_help_builder (GTK_BUILDER (xml));
+
+ else if (GLADE_IS_XML (xml))
+ connect_help_glade (GLADE_XML (xml));
+
+ else
+ {
+ g_error ("XML of type %s", G_OBJECT_TYPE_NAME (xml));
+ }
+}
+
+
void
reference_manual (GtkMenuItem *menu, gpointer data)
char * pspp_locale_to_utf8 (const gchar *text, gssize len, GError **err);
-void connect_help (GladeXML *);
+void connect_help (gpointer *);
void reference_manual (GtkMenuItem *, gpointer);
vs->missing_val_dialog = missing_val_dialog_create (builder);
vs->var_type_dialog = var_type_dialog_create (builder);
+ connect_help (builder);
+
g_object_unref (builder);
vs->dispose_has_run = FALSE;
struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
- // connect_help (xml);
-
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");