--- /CVS/gtk+/tests/testtreeview.c	2003-10-12 00:21:04.000000000 +0200
+++ testtreeview.c	2003-11-26 15:42:16.000000000 +0200
@@ -2,7 +2,7 @@
 #include <string.h>
 #include "prop-editor.h"
 #include <gtk/gtk.h>
-
+ 
 
 /* Don't copy this bad example; inline RGB data is always a better
  * idea than inline XPMs.
@@ -160,6 +160,7 @@
 setup_column (GtkTreeViewColumn *col)
 {
   gtk_tree_view_column_set_clickable (col, TRUE);
+  gtk_tree_view_column_set_resizable (col, TRUE);   //bidi
   g_signal_connect (col,
 		    "clicked",
 		    G_CALLBACK (col_clicked_cb),
@@ -272,7 +273,7 @@
       
       rend = gtk_cell_renderer_text_new ();
       
-      col = gtk_tree_view_column_new_with_attributes ("Column 1",
+      col = gtk_tree_view_column_new_with_attributes ("",
                                                       rend,
                                                       "text", 1,
                                                       NULL);
@@ -281,14 +282,14 @@
       gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
       
       col = gtk_tree_view_column_new();
-      gtk_tree_view_column_set_title (col, "Column 2");
+      gtk_tree_view_column_set_title (col, "");
       
       rend = gtk_cell_renderer_pixbuf_new ();
       gtk_tree_view_column_pack_start (col, rend, FALSE);
       gtk_tree_view_column_add_attribute (col, rend, "pixbuf", 2);
-      rend = gtk_cell_renderer_text_new ();
-      gtk_tree_view_column_pack_start (col, rend, TRUE);
-      gtk_tree_view_column_add_attribute (col, rend, "text", 0);
+//      rend = gtk_cell_renderer_text_new ();
+//      gtk_tree_view_column_pack_start (col, rend, TRUE);
+//      gtk_tree_view_column_add_attribute (col, rend, "text", 1);
 
       setup_column (col);
       
@@ -301,7 +302,7 @@
       g_signal_connect (rend, "toggled",
 			G_CALLBACK (toggled_callback), tree_view);
       
-      col = gtk_tree_view_column_new_with_attributes ("Column 3",
+      col = gtk_tree_view_column_new_with_attributes ("",
                                                       rend,
                                                       "active", BOOL_COLUMN,
                                                       NULL);
@@ -318,7 +319,7 @@
       
       gtk_widget_show (image);
       
-      gtk_tree_view_column_set_widget (col, image);
+//      gtk_tree_view_column_set_widget (col, image);
       
       rend = gtk_cell_renderer_toggle_new ();
 
@@ -330,7 +331,7 @@
       g_signal_connect (rend, "toggled",
 			G_CALLBACK (toggled_callback), tree_view);
       
-      col = gtk_tree_view_column_new_with_attributes ("Column 4",
+      col = gtk_tree_view_column_new_with_attributes ("",
                                                       rend,
                                                       "active", BOOL_COLUMN,
                                                       NULL);
@@ -339,11 +340,9 @@
       
       gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
       
-#if 0
-
       rend = gtk_cell_renderer_text_new ();
       
-      col = gtk_tree_view_column_new_with_attributes ("Column 5",
+      col = gtk_tree_view_column_new_with_attributes ("",
                                                       rend,
                                                       "text", 3,
                                                       NULL);
@@ -351,6 +350,7 @@
       setup_column (col);
       
       gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
+#if 0
       
       rend = gtk_cell_renderer_text_new ();
       
@@ -414,7 +414,7 @@
     case COLUMNS_ONE:
       rend = gtk_cell_renderer_text_new ();
       
-      col = gtk_tree_view_column_new_with_attributes ("Column 0",
+      col = gtk_tree_view_column_new_with_attributes ("",
                                                       rend,
                                                       "text", 0,
                                                       NULL);
@@ -512,7 +512,7 @@
   
   gtk_tree_store_append (store, &iter, parent_iter);
 
-  str = g_strdup_printf ("%ld", (glong)type);
+  str = "\327\251\327\234\327\225\327\235";
   gtk_tree_store_set (store, &iter, 0, str, 1, g_type_name (type),
                       2, our_pixbuf,
                       3, 7.0, 4, (guint) 9000,
@@ -609,6 +609,14 @@
     TARGET_GTK_TREE_MODEL_ROW }
 };
 
+void change_cont_direction(GtkWidget        *widget,
+                           GtkContainer     *fs)
+{
+  GtkTextDirection dir = gtk_widget_get_direction(GTK_WIDGET(fs)) == GTK_TEXT_DIR_RTL?
+                         GTK_TEXT_DIR_LTR : GTK_TEXT_DIR_RTL;
+  gtk_widget_set_direction(GTK_WIDGET(fs),dir);
+}
+
 int
 main (int    argc,
       char **argv)
@@ -619,6 +627,7 @@
   GtkWidget *table;
   GtkWidget *om;
   GtkWidget *menu;
+  GtkWidget *button;
   GtkTreeModel *model;
   gint i;
   
@@ -639,8 +648,8 @@
   model = create_tree_model ();
   models[MODEL_SORTED_TREE] = gtk_tree_model_sort_new_with_model (model);
   g_object_unref (model);
-
-  models[MODEL_EMPTY_LIST] = GTK_TREE_MODEL (gtk_list_store_new (1, G_TYPE_INT));
+   
+  models[MODEL_EMPTY_LIST] = GTK_TREE_MODEL (gtk_list_store_new (1, G_TYPE_INT));  
   models[MODEL_EMPTY_TREE] = GTK_TREE_MODEL (gtk_tree_store_new (1, G_TYPE_INT));
   
   models[MODEL_NULL] = NULL;
@@ -649,11 +658,21 @@
   
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
-  gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
+  gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
 
-  table = gtk_table_new (3, 1, FALSE);
+  table = gtk_table_new (4, 1, FALSE);
+
+      button = gtk_button_new_with_label ("Change Dir");
+      g_signal_connect (button, "clicked",
+                        G_CALLBACK (change_cont_direction),
+                        window);
+      gtk_widget_show (button);
 
   gtk_container_add (GTK_CONTAINER (window), table);
+      gtk_table_attach (GTK_TABLE (table), button,
+                    0, 1, 0, 1,
+                    0, 0, 
+                    0, 0);
 
   tv = gtk_tree_view_new_with_model (models[0]);
   
@@ -699,7 +718,7 @@
   gtk_option_menu_set_menu (GTK_OPTION_MENU (om), menu);
   
   gtk_table_attach (GTK_TABLE (table), om,
-                    0, 1, 0, 1,
+                    0, 1, 1, 2,
                     0, 0, 
                     0, 0);
 
@@ -732,7 +751,7 @@
   gtk_option_menu_set_menu (GTK_OPTION_MENU (om), menu);
   
   gtk_table_attach (GTK_TABLE (table), om,
-                    0, 1, 1, 2,
+                    0, 1, 2, 3,
                     0, 0, 
                     0, 0);
 
@@ -750,7 +769,7 @@
                                   GTK_POLICY_AUTOMATIC);
   
   gtk_table_attach (GTK_TABLE (table), sw,
-                    0, 1, 2, 3,
+                    0, 1, 3, 4,
                     GTK_EXPAND | GTK_FILL,
                     GTK_EXPAND | GTK_FILL,
                     0, 0);
