- var_predicate_func *predicate = data;
- struct variable *var;
- PsppireDict *dict = PSPPIRE_DICT (model);
-
- GtkTreePath *path = gtk_tree_model_get_path (model, iter);
-
- gint *idx = gtk_tree_path_get_indices (path);
-
- var = psppire_dict_get_variable (dict, *idx);
-
- gtk_tree_path_free (path);
-
- return predicate (var);
-}
-
-/* Sets up TREEVIEW to display the variables of DICT.
- MODE is the selection mode for TREEVIEW.
- PREDICATE determines which variables should be visible, or NULL if
- all are to be visible.
- */
-void
-attach_dictionary_to_treeview (GtkTreeView *treeview, PsppireDict *dict,
- GtkSelectionMode mode,
- var_predicate_func *predicate
- )
-{
- GtkTreeViewColumn *col;
-
- GtkTreeSelection *selection =
- gtk_tree_view_get_selection (treeview);
-
- GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
- GtkTreeModel *model ;
-
- if ( predicate )
- {
- model = gtk_tree_model_filter_new (GTK_TREE_MODEL (dict),
- NULL);
-
- gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (model),
- filter_variables,
- predicate,
- NULL);
- }
- else