pspp-sheet-view: Adapt to GTK+3 scrolling infrastructure.
[pspp] / src / ui / gui / psppire-var-sheet.c
index 0234573196c96d0f1675344d2027e24f404f7ab6..d62a97e1fd1fa08866827dc05ae3d83b729e42bd 100644 (file)
@@ -453,8 +453,8 @@ on_type_click (PsppireCellRendererButton *cell,
 
   format = *var_get_print_format (var);
   psppire_var_type_dialog_run (GTK_WINDOW (toplevel), &format);
-  var_set_width (var, fmt_var_width (&format));
-  var_set_both_formats (var, &format);
+
+  var_set_width_and_formats (var, fmt_var_width (&format), &format, &format);
 }
 
 static void
@@ -1054,6 +1054,16 @@ psppire_var_sheet_row_number_double_clicked (PsppireCellRendererButton *button,
   gtk_tree_path_free (path);
 }
 
+static void
+psppire_var_sheet_variables_column_clicked (PsppSheetViewColumn *column,
+                                            PsppireVarSheet *var_sheet)
+{
+  PsppSheetView *sheet_view = PSPP_SHEET_VIEW (var_sheet);
+  PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view);
+
+  pspp_sheet_selection_select_all (selection);
+}
+
 static PsppSheetViewColumn *
 make_row_number_column (PsppireVarSheet *var_sheet)
 {
@@ -1068,9 +1078,14 @@ make_row_number_column (PsppireVarSheet *var_sheet)
 
   column = pspp_sheet_view_column_new_with_attributes (_("Variable"),
                                                        renderer, NULL);
+  pspp_sheet_view_column_set_clickable (column, TRUE);
   pspp_sheet_view_column_set_cell_data_func (
     column, renderer, render_row_number_cell, var_sheet, NULL);
   pspp_sheet_view_column_set_fixed_width (column, 50);
+  g_signal_connect (column, "clicked",
+                    G_CALLBACK (psppire_var_sheet_variables_column_clicked),
+                    var_sheet);
+
   return column;
 }
 
@@ -1273,7 +1288,9 @@ refresh_model (PsppireVarSheet *var_sheet)
 }
 
 static void
-on_var_changed (PsppireDict *dict, glong row, PsppireVarSheet *var_sheet)
+on_var_changed (PsppireDict *dict, glong row,
+               guint what, const struct variable *oldvar,
+               PsppireVarSheet *var_sheet)
 {
   PsppireEmptyListStore *store;