X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire-var-view.c;h=13db8e60e4c0cd2c78866cc4ac2cc07e9c625b18;hb=dae6cb8b61f6c4864c428e94aaaf680de510041e;hp=47c845cba2c1e496a51ec4005de66876e4c75a1a;hpb=e2da62d735c597afeef2e0e9b36e5a4a83d7da94;p=pspp diff --git a/src/ui/gui/psppire-var-view.c b/src/ui/gui/psppire-var-view.c index 47c845cba2..13db8e60e4 100644 --- a/src/ui/gui/psppire-var-view.c +++ b/src/ui/gui/psppire-var-view.c @@ -21,6 +21,7 @@ #include "psppire-var-ptr.h" #include "psppire-select-dest.h" +#include #include #include @@ -289,7 +290,10 @@ psppire_var_view_base_finalize (PsppireVarViewClass *class, static void psppire_var_view_init (PsppireVarView *vv) { + GtkTreeSelection* selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (vv)); vv->cols = 0; + + gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); } @@ -368,6 +372,31 @@ psppire_var_view_append_names (PsppireVarView *vv, gint column, GString *string) return n_vars; } +/* Return a linked list of struct variables which are + contained in VV. + The caller is responsible for freeing the returned list. + The variables however are owned by their dictionary + and should not be freed. + */ +GSList * +psppire_var_view_list_names (PsppireVarView *vv, gint column) +{ + GtkTreeIter iter; + GSList *list = NULL; + + if ( psppire_var_view_get_iter_first (vv, &iter) ) + { + do + { + const struct variable *var = psppire_var_view_get_variable (vv, column, &iter); + list = g_slist_prepend (list, CONST_CAST (struct variable *, var)); + } + while (psppire_var_view_get_iter_next (vv, &iter)); + } + + return list; +} + /* Append the names of selected variables to STR