diff -uprN gtk+-cvs-20031119/tests/testgtk.c gtk+/tests/testgtk.c
--- gtk+-cvs-20031119/tests/testgtk.c	2003-11-19 16:53:26.000000000 +0900
+++ gtk+/tests/testgtk.c	2003-11-19 16:55:11.000000000 +0900
@@ -54,6 +54,7 @@
 #include "circles.xbm"
 #include "test.xpm"
 
+
 gboolean
 file_exists (const char *filename)
 {
@@ -4384,12 +4385,36 @@ scrolled_windows_remove (GtkWidget *widg
 }
 
 static void
+set_direction_recurse (GtkWidget *widget,
+		       gpointer   data)
+{
+  GtkTextDirection *dir = data;
+  
+  gtk_widget_set_direction (widget, *dir);
+  if (GTK_IS_CONTAINER (widget))
+    gtk_container_foreach (GTK_CONTAINER (widget),
+			   set_direction_recurse,
+			   data);
+}
+
+void
+flipping_cont_toggled_cb (GtkWidget *widget, gpointer data)
+{
+  GtkWidget *cont = GTK_WIDGET(data);
+  int state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+  int new_direction = state ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR;
+
+  set_direction_recurse(cont,&new_direction);
+}
+
+static void
 create_scrolled_windows (GtkWidget *widget)
 {
   static GtkWidget *window;
   GtkWidget *scrolled_window;
   GtkWidget *table;
   GtkWidget *button;
+  GtkWidget *check_button;                    //bidi
   char buffer[32];
   int i, j;
 
@@ -4408,6 +4433,18 @@ create_scrolled_windows (GtkWidget *widg
       gtk_container_set_border_width (GTK_CONTAINER (window), 0);
 
 
+      check_button = gtk_check_button_new_with_label ("Right-to-left global direction"); //bidi
+      gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox),                           //bidi
+                          check_button, FALSE, FALSE, 0);                                  //bidi
+      gtk_widget_show (check_button);
+
+      if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
+                                                                                
+      g_signal_connect (check_button, "toggled",
+                        G_CALLBACK (flipping_cont_toggled_cb), window);
+
+
       scrolled_window = gtk_scrolled_window_new (NULL, NULL);
       gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10);
       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
@@ -7002,7 +7039,7 @@ void create_ctree (GtkWidget *widget)
 				      GTK_POLICY_AUTOMATIC,
 				      GTK_POLICY_ALWAYS);
       gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0);
-
+  
       ctree = GTK_CTREE (gtk_ctree_new_with_titles (2, 0, title));
       gtk_container_add (GTK_CONTAINER (scrolled_win), GTK_WIDGET (ctree));
 
@@ -7432,20 +7469,7 @@ flipping_toggled_cb (GtkWidget *widget, 
 
   gtk_widget_set_default_direction (new_direction);
 }
-
-static void
-set_direction_recurse (GtkWidget *widget,
-		       gpointer   data)
-{
-  GtkTextDirection *dir = data;
-  
-  gtk_widget_set_direction (widget, *dir);
-  if (GTK_IS_CONTAINER (widget))
-    gtk_container_foreach (GTK_CONTAINER (widget),
-			   set_direction_recurse,
-			   data);
-}
-
+ 
 static GtkWidget *
 create_forward_back (const char       *title,
 		     GtkTextDirection  text_dir)
@@ -8536,9 +8560,9 @@ tab_pack (GtkToggleButton *button, GtkWi
   gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
 					&expand, &fill, NULL);
   gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
-				      expand, fill, button->active);
+				      expand, fill, button->active? GTK_PACK_END : GTK_PACK_START);
 }
-
+  
 static void
 create_pages (GtkNotebook *notebook, gint start, gint end)
 {
@@ -12972,3 +12996,4 @@ main (int argc, char *argv[])
     }
   return 0;
 }
+
