From 7c8ae8a5f5bbbd1f140f2daa3285f173da00085e Mon Sep 17 00:00:00 2001 From: Lars Hamann Date: Tue, 2 Jun 1998 19:32:33 +0000 Subject: [PATCH] reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkcontainer.c | 12 ++++++------ gtk/gtknotebook.c | 26 +++++++++++++------------- 9 files changed, 61 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e5a959929..1503c8a478 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jun 2 20:04:45 1998 Lars Hamann + + * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) + * gtk/gtkcontainer.c (gtk_container_focus_move): + reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER + Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 4e5a959929..1503c8a478 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Tue Jun 2 20:04:45 1998 Lars Hamann + + * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) + * gtk/gtkcontainer.c (gtk_container_focus_move): + reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER + Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4e5a959929..1503c8a478 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Tue Jun 2 20:04:45 1998 Lars Hamann + + * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) + * gtk/gtkcontainer.c (gtk_container_focus_move): + reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER + Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 4e5a959929..1503c8a478 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Tue Jun 2 20:04:45 1998 Lars Hamann + + * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) + * gtk/gtkcontainer.c (gtk_container_focus_move): + reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER + Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4e5a959929..1503c8a478 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Tue Jun 2 20:04:45 1998 Lars Hamann + + * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) + * gtk/gtkcontainer.c (gtk_container_focus_move): + reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER + Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4e5a959929..1503c8a478 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Tue Jun 2 20:04:45 1998 Lars Hamann + + * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) + * gtk/gtkcontainer.c (gtk_container_focus_move): + reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER + Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4e5a959929..1503c8a478 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Tue Jun 2 20:04:45 1998 Lars Hamann + + * gtk/gtknotebook.c (gtk_notebook_page_select) (gtk_notebook_focus) + * gtk/gtkcontainer.c (gtk_container_focus_move): + reversed test sequence for GTK_WIDGET_CAN_FOCUS and GTK_IS_CONTAINER + Tue Jun 2 13:04:06 BST 1998 Tony Gale * docs/gtk_tut.sgml: minor changes to support auto diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index a905b1e69b..4595e7fcad 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1044,16 +1044,16 @@ gtk_container_focus_move (GtkContainer *container, } else if (GTK_WIDGET_VISIBLE (child)) { - if (GTK_WIDGET_CAN_FOCUS (child)) - { - gtk_widget_grab_focus (child); - return TRUE; - } - else if (GTK_IS_CONTAINER (child)) + if (GTK_IS_CONTAINER (child)) { if (gtk_container_focus (GTK_CONTAINER (child), direction)) return TRUE; } + else if (GTK_WIDGET_CAN_FOCUS (child)) + { + gtk_widget_grab_focus (child); + return TRUE; + } } } diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index b5c19f0cf5..d4704506d0 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2650,7 +2650,13 @@ gtk_notebook_focus (GtkContainer *container, { if (GTK_WIDGET_VISIBLE (notebook->cur_page->child)) { - if (GTK_WIDGET_CAN_FOCUS (notebook->cur_page->child)) + if (GTK_IS_CONTAINER (notebook->cur_page->child)) + { + if (gtk_container_focus + (GTK_CONTAINER (notebook->cur_page->child), direction)) + return TRUE; + } + else if (GTK_WIDGET_CAN_FOCUS (notebook->cur_page->child)) { if (!focus_child) { @@ -2658,12 +2664,6 @@ gtk_notebook_focus (GtkContainer *container, return TRUE; } } - else if (GTK_IS_CONTAINER (notebook->cur_page->child)) - { - if (gtk_container_focus - (GTK_CONTAINER (notebook->cur_page->child), direction)) - return TRUE; - } } return FALSE; } @@ -2759,17 +2759,17 @@ gtk_notebook_page_select (GtkNotebook *notebook) if (GTK_WIDGET_VISIBLE (page->child)) { - if (GTK_WIDGET_CAN_FOCUS (page->child)) - { - gtk_widget_grab_focus (page->child); - return TRUE; - } - else if (GTK_IS_CONTAINER (page->child)) + if (GTK_IS_CONTAINER (page->child)) { if (gtk_container_focus (GTK_CONTAINER (page->child), GTK_DIR_TAB_FORWARD)) return TRUE; } + else if (GTK_WIDGET_CAN_FOCUS (page->child)) + { + gtk_widget_grab_focus (page->child); + return TRUE; + } } } return FALSE;