Focus var/data sheet after switching tabs
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 15 Mar 2009 22:15:00 +0000 (07:15 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 15 Mar 2009 22:15:00 +0000 (07:15 +0900)
src/ui/gui/psppire-data-editor.c

index 2a05538db148b938848ce7c8aeb58bbd36280453..861191917e4160e524ed3927e30a1f3389aac42b 100644 (file)
@@ -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;
 }