- return var;
-}
-
-
-
-
-/* A (*GtkTreeCellDataFunc) function.
- This function expects TREEMODEL to hold G_TYPE_INT. The ints it holds
- are the indices of the variables in the dictionary, which DATA points to.
- It renders the name of the variable into CELL.
-*/
-void
-cell_var_name (GtkTreeViewColumn *tree_column,
- GtkCellRenderer *cell,
- GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gpointer data)
-{
- PsppireDict *dict = data;
- struct variable *var;
- gchar *name;
-
- var = get_selected_variable (tree_model, iter, dict);
-
- name = pspp_locale_to_utf8 (var_get_name (var), -1, NULL);
- g_object_set (cell, "text", name, NULL);
- g_free (name);
-}
-
-
-
-/* Set a model for DEST, which is an GtkListStore of g_int's
- whose values are the indices into DICT */
-void
-set_dest_model (GtkTreeView *dest, PsppireDict *dict)
-{
- GtkTreeViewColumn *col;
- GtkListStore *dest_list = gtk_list_store_new (1, G_TYPE_INT);
- GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
-
- gtk_tree_view_set_model (GTK_TREE_VIEW (dest), GTK_TREE_MODEL (dest_list));
-
- col = gtk_tree_view_column_new_with_attributes ("Var",
- renderer,
- "text",
- 0,
- NULL);
-
- gtk_tree_view_column_set_cell_data_func (col, renderer,
- cell_var_name,
- dict, 0);
-
- /* FIXME: make this a value in terms of character widths */
- g_object_set (col, "min-width", 100, NULL);
-
- gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_FIXED);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (dest), col);