Focus the sheet when the user hits enter in the datum entry
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 6 Sep 2017 09:27:59 +0000 (11:27 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 6 Sep 2017 09:27:59 +0000 (11:27 +0200)
src/ui/gui/psppire-data-editor.c

index d8c5cbf3a4541b0b8eec035e72535ceee198bbd8..b9c6fb62148f299421bf1c8aa6f32d75a47b5dca 100644 (file)
@@ -378,6 +378,9 @@ on_datum_entry_activate (GtkEntry *entry, PsppireDataEditor *de)
          psppire_data_store_set_value (de->data_store, row, var, &val);
        }
       value_destroy (&val, width);
+
+      gtk_widget_grab_focus (de->data_sheet);
+      ssw_sheet_set_active_cell (de->data_sheet, col, row, NULL);
     }
 }
 
@@ -488,8 +491,8 @@ psppire_data_editor_init (PsppireDataEditor *de)
   gtk_widget_set_valign (de->cell_ref_label, GTK_ALIGN_CENTER);
 
   de->datum_entry = psppire_value_entry_new ();
-  g_signal_connect (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (de->datum_entry))),
-                    "activate", G_CALLBACK (on_datum_entry_activate), de);
+  g_signal_connect (de->datum_entry, "edit-done",
+                   G_CALLBACK (on_datum_entry_activate), de);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   gtk_box_pack_start (GTK_BOX (hbox), de->cell_ref_label, FALSE, FALSE, 0);