From: John Darrington Date: Thu, 5 Mar 2009 09:14:45 +0000 (+0900) Subject: Fix problem focusing variable sheet X-Git-Tag: v0.7.3~254 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae027d5df3f9a6d9368dd6d13f3bf52142dd3c06;p=pspp-builds.git Fix problem focusing variable sheet --- diff --git a/lib/gtk-contrib/psppire-sheet.c b/lib/gtk-contrib/psppire-sheet.c index dac561a1..31ecbcbf 100644 --- a/lib/gtk-contrib/psppire-sheet.c +++ b/lib/gtk-contrib/psppire-sheet.c @@ -476,6 +476,11 @@ static void psppire_sheet_size_request (GtkWidget *widget, static void psppire_sheet_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static gboolean psppire_sheet_focus_in (GtkWidget *widget, + GdkEventFocus *event, + gpointer user_data); + + /* Sheet queries */ static gboolean psppire_sheet_range_isvisible (const PsppireSheet *sheet, @@ -1064,7 +1069,7 @@ psppire_sheet_class_init (PsppireSheetClass *klass) widget_class->expose_event = psppire_sheet_expose; widget_class->size_request = psppire_sheet_size_request; widget_class->size_allocate = psppire_sheet_size_allocate; - widget_class->focus_in_event = NULL; + widget_class->focus_in_event = psppire_sheet_focus_in; widget_class->focus_out_event = NULL; klass->set_scroll_adjustments = psppire_sheet_set_scroll_adjustments; @@ -4052,6 +4057,20 @@ psppire_sheet_crossing_notify (GtkWidget *widget, return TRUE; } + +static gboolean +psppire_sheet_focus_in (GtkWidget *w, + GdkEventFocus *event, + gpointer user_data) +{ + PsppireSheet *sheet = PSPPIRE_SHEET (w); + + gtk_widget_grab_focus (sheet->entry_widget); + + return TRUE; +} + + static void psppire_sheet_extend_selection (PsppireSheet *sheet, gint row, gint column) { @@ -4584,8 +4603,6 @@ set_entry_widget_font (PsppireSheet *sheet) gtk_widget_modify_style (sheet->entry_widget, style); } - - static void create_sheet_entry (PsppireSheet *sheet) { diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 735d4328..2a05538d 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -548,6 +548,8 @@ psppire_data_editor_class_init (PsppireDataEditorClass *klass) object_class->set_property = psppire_data_editor_set_property; object_class->get_property = psppire_data_editor_get_property; + + data_store_spec = g_param_spec_pointer ("data-store", "Data Store", @@ -990,11 +992,11 @@ psppire_data_editor_init (PsppireDataEditor *de) G_CALLBACK (on_switch_page), NULL); + g_object_set (de, "can-focus", FALSE, NULL); g_signal_connect (de, "map", G_CALLBACK (on_map), NULL); - // psppire_sheet_hide_column_titles (de->var_sheet); // psppire_sheet_hide_row_titles (de->data_sheet); @@ -1884,5 +1886,3 @@ on_owner_change (GtkClipboard *clip, GdkEventOwnerChange *event, gpointer data) g_signal_emit (de, data_editor_signals[DATA_AVAILABLE_CHANGED], 0, compatible_target); } - -