From: John Darrington Date: Wed, 6 Sep 2017 09:27:59 +0000 (+0200) Subject: Focus the sheet when the user hits enter in the datum entry X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=9c5440448a9999db5515937c85a3f37deb033efa Focus the sheet when the user hits enter in the datum entry --- diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index d8c5cbf3a4..b9c6fb6214 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -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);