+
+
+
+/* Update the data_ref_entry with the reference of the active cell */
+static gint
+update_data_ref_entry (const GtkSheet *sheet, gint row, gint col, gpointer data)
+{
+ GladeXML *data_editor_xml = data;
+
+ /* The entry where the reference to the current cell is displayed */
+ GtkEntry *cell_ref_entry;
+
+ PsppireDataStore *data_store = PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet));
+
+ g_return_val_if_fail (data_editor_xml, FALSE);
+
+ if (data_store)
+ {
+ const struct variable *pv =
+ psppire_dict_get_variable (data_store->dict, col);
+
+ gchar *text ;
+ gchar *s ;
+
+ text = g_strdup_printf ("%d: %s", row,
+ pv ? var_get_name (pv) : "");
+
+ cell_ref_entry = GTK_ENTRY (get_widget_assert (data_editor_xml,
+ "cell_ref_entry"));
+
+ s = pspp_locale_to_utf8 (text, -1, 0);
+
+ g_free (text);
+
+ gtk_entry_set_text (cell_ref_entry, s);
+
+ g_free (s);
+ }
+
+ return FALSE;
+}