From a86739f7fdb0a11a16f6c0a47c0e90773f134a53 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 16 Mar 2009 07:15:00 +0900 Subject: [PATCH] Focus var/data sheet after switching tabs --- src/ui/gui/psppire-data-editor.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 2a05538d..86119191 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -1457,13 +1457,19 @@ static gboolean on_switch_page (PsppireDataEditor *de, GtkNotebookPage *p, gint pagenum, gpointer data) { - if ( pagenum != PSPPIRE_DATA_EDITOR_DATA_VIEW ) + switch (pagenum) { + case PSPPIRE_DATA_EDITOR_DATA_VIEW: + gtk_widget_grab_focus (de->data_vbox); + on_select_range (de); + break; + case PSPPIRE_DATA_EDITOR_VARIABLE_VIEW: + gtk_widget_grab_focus (de->var_sheet); emit_selected_signal (de); - return TRUE; - } - - on_select_range (de); + break; + default: + break; + }; return TRUE; } -- 2.30.2