X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Ft-test-paired-samples.c;h=68b45fcb5a6a934378305a5bc30cbddd19b03c17;hb=fd0c595927a23ea0373551a1eed4570388ea0fc5;hp=ca1d776a7294f6bed0b91060e4be8f7878ef4b2c;hpb=8af88c0b7ea2fe75df7e45497988ed0371006a86;p=pspp-builds.git diff --git a/src/ui/gui/t-test-paired-samples.c b/src/ui/gui/t-test-paired-samples.c index ca1d776a..68b45fcb 100644 --- a/src/ui/gui/t-test-paired-samples.c +++ b/src/ui/gui/t-test-paired-samples.c @@ -20,16 +20,19 @@ #include #include "psppire-data-window.h" +#include "psppire-selector.h" +#include "psppire-var-view.h" #include "psppire-dict.h" #include "psppire-var-store.h" #include "t-test-paired-samples.h" #include "t-test-options.h" -#include "dict-display.h" #include "dialog-common.h" #include "psppire-dialog.h" +#include "executor.h" + #include "helper.h" #include "psppire-var-ptr.h" @@ -54,11 +57,11 @@ generate_syntax (const struct tt_paired_samples_dialog *d) gchar *text = NULL; GString *str = g_string_new ("T-TEST \n\tPAIRS = "); - append_variable_names (str, d->dict, GTK_TREE_VIEW (d->pairs_treeview), 0); + psppire_var_view_append_names (PSPPIRE_VAR_VIEW (d->pairs_treeview), 0, str); g_string_append (str, " WITH "); - append_variable_names (str, d->dict, GTK_TREE_VIEW (d->pairs_treeview), 1); + psppire_var_view_append_names (PSPPIRE_VAR_VIEW (d->pairs_treeview), 1, str); g_string_append (str, " (PAIRED)"); g_string_append (str, "\n"); @@ -149,7 +152,7 @@ select_as_pair_member (GtkTreeIter source_iter, } } - +#if 0 /* Append a new column to TV at position C, and heading TITLE */ static void add_new_column (GtkTreeView *tv, const gchar *title, gint c) @@ -173,6 +176,8 @@ add_new_column (GtkTreeView *tv, const gchar *title, gint c) gtk_tree_view_column_add_attribute (col, renderer, "text", c); } +#endif + /* Pops up the dialog box */ void @@ -197,7 +202,7 @@ t_test_paired_samples_dialog (GObject *o, gpointer data) g_object_get (de->data_editor, "var-store", &vs, NULL); - tt_d.dict = vs->dict; + g_object_get (vs, "dictionary", &tt_d.dict, NULL); tt_d.pairs_treeview = get_widget_assert (xml, "paired-samples-t-test-treeview2"); tt_d.opt = tt_options_dialog_create (xml, GTK_WINDOW (de)); @@ -205,35 +210,16 @@ t_test_paired_samples_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - attach_dictionary_to_treeview (GTK_TREE_VIEW (dict_view), - vs->dict, - GTK_SELECTION_MULTIPLE, - var_is_numeric); - - { - tt_d.list_store = - GTK_TREE_MODEL ( - gtk_list_store_new (2, - PSPPIRE_VAR_PTR_TYPE, - PSPPIRE_VAR_PTR_TYPE)); - - - gtk_tree_view_set_model (GTK_TREE_VIEW (tt_d.pairs_treeview), - GTK_TREE_MODEL (tt_d.list_store)); - - - add_new_column (GTK_TREE_VIEW (tt_d.pairs_treeview), _("Var 1"), 0); - add_new_column (GTK_TREE_VIEW (tt_d.pairs_treeview), _("Var 2"), 1); - } - + g_object_set (dict_view, "model", tt_d.dict, + "predicate", + var_is_numeric, NULL); - psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - dict_view, - tt_d.pairs_treeview, - select_as_pair_member, - NULL, - &tt_d); + + tt_d.list_store = gtk_tree_view_get_model (GTK_TREE_VIEW (tt_d.pairs_treeview)); + psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector), + select_as_pair_member, + &tt_d); g_signal_connect_swapped (dialog, "refresh", G_CALLBACK (refresh), &tt_d);