PATCH: Fix for gtk_widget_show_all on Notebooks.



The following patch fixes gtk_widget_show_all for containers that have
normal children and "internal" children.  An example of an "internal"
child is the Notebook widget.  The problem is that there are two methods
for iterating over children.  The forall method includes the "internal"
children and the foreach method does not.  The current
gtk_widget_show_all picked the wrong one, leading to the following
exchange on the list about a month ago:

[OT = Owen Taylor, AC = Antonio Campos ]

OT> show_all on a notebook should show all the pages correctly - 
OT> do you have an example where it doesn't? 

AC> Well, yes, maybe I am more confused than you, but I believe that 
AC> gtk_widget_show_all() in gtknotebooks doesn't show the notebook
AC> labels, which it's a bit strange (but maybe only a lack of
AC> documentation about which are the children of the notebook as a
AC> container). 

The patch follows.

--- gtkcontainer.c.original	Mon Mar 27 19:24:43 2000
+++ gtkcontainer.c	Mon Apr 17 18:20:07 2000
@@ -1856,7 +1856,7 @@
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_CONTAINER (widget));
 
-  gtk_container_foreach (GTK_CONTAINER (widget),
+  gtk_container_forall (GTK_CONTAINER (widget),
 			 (GtkCallback) gtk_widget_show_all,
 			 NULL);
   gtk_widget_show (widget);
@@ -1869,7 +1869,7 @@
   g_return_if_fail (GTK_IS_CONTAINER (widget));
 
   gtk_widget_hide (widget);
-  gtk_container_foreach (GTK_CONTAINER (widget),
+  gtk_container_forall (GTK_CONTAINER (widget),
 			 (GtkCallback) gtk_widget_hide_all,
 			 NULL);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]