MEANS: Fix potential errors in gui syntax generation
[pspp] / src / ui / gui / psppire-dialog-action-examine.c
index 904beec1e810b2abc416bb483a7461c6a7ee39ef..a01d4536f8cbd96d57ebf7e193568af1bd32704c 100644 (file)
@@ -20,6 +20,8 @@
 #include "psppire-dialog-action-examine.h"
 
 #include "psppire-var-view.h"
+#include "dialog-common.h"
+#include "psppire-selector.h"
 #include "psppire-dict.h"
 #include "psppire-dialog.h"
 #include "builder-wrapper.h"
@@ -206,6 +208,8 @@ psppire_dialog_action_examine_activate (GtkAction *a)
   GtkWidget *stats_button = get_widget_assert (xml, "stats-button");
   GtkWidget *opts_button = get_widget_assert (xml, "opts-button");
 
+  GtkWidget *dep_sel = get_widget_assert (xml, "psppire-selector1");
+
   pda->dialog    = get_widget_assert   (xml, "examine-dialog");
   pda->source    = get_widget_assert   (xml, "treeview1");
   act->variables = get_widget_assert   (xml, "treeview2");
@@ -222,10 +226,7 @@ psppire_dialog_action_examine_activate (GtkAction *a)
   act->pairwise    = get_widget_assert (xml, "radiobutton2");
   act->report      = get_widget_assert (xml, "radiobutton3");
 
-  g_object_set (pda->source,
-               "model", pda->dict,
-               "predicate", var_is_numeric,
-               NULL);
+  psppire_selector_set_allow (PSPPIRE_SELECTOR (dep_sel), numeric_only);
 
   psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
@@ -237,6 +238,8 @@ psppire_dialog_action_examine_activate (GtkAction *a)
                            G_CALLBACK (run_opts_dialog), act);
 
   PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_examine_parent_class)->activate (pda);
+  
+  g_object_unref (xml);
 }
 
 static void