+}
+
+
+static void
+populate_text (GtkTreeSelection *selection, gpointer data)
+{
+ GtkTreeView *treeview = gtk_tree_selection_get_tree_view (selection);
+ GString *gstring;
+ PsppireDict *dict;
+ size_t n_vars;
+ size_t i;
+
+ GtkTextBuffer *textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (data));
+ struct variable **vars;
+
+ g_object_get (treeview, "model", &dict,
+ NULL);
+
+ gstring = g_string_sized_new (200);
+
+ psppire_dict_view_get_selected_variables (PSPPIRE_DICT_VIEW (treeview),
+ &vars, &n_vars);
+ for (i = 0; i < n_vars; i++)
+ {
+ if (i > 0)
+ g_string_append_c (gstring, '\n');
+ populate_text_var (gstring, vars[i]);
+ }
+ g_free (vars);