From 428ee3e6955aabbe0d9341708ad15fd12a404716 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 28 Oct 2012 13:22:33 -0700 Subject: [PATCH] pspp-sheet-view: Fix warning using arrow keys to navigate column buttons. Before this commit, clicking on a column head button in the data sheet, then holding down the right arrow key until the data sheet began to scroll right would often produce a warning of the form: ** (psppire:16451): WARNING **: Internal button not found because nothing caused the underlying GtkButton to be instantiated in this scenario. This commit fixes the problem. --- src/ui/gui/pspp-sheet-view.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index 9dbec5916b..38c609669c 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -6712,13 +6712,16 @@ pspp_sheet_view_header_focus (PsppSheetView *tree_view, break; } column = tmp_list->data; - if (column->button && - column->visible && + if (column->visible && pspp_sheet_view_column_can_focus (column)) - { - pspp_sheet_view_focus_column (tree_view, column, - clamp_column_visible); - return TRUE; + { + pspp_sheet_view_column_set_need_button (column, TRUE); + if (column->button) + { + pspp_sheet_view_focus_column (tree_view, column, + clamp_column_visible); + return TRUE; + } } } return FALSE; -- 2.30.2