]> Pileus Git - ~andy/gtk/blobdiff - tests/testtreecolumns.c
Use gtk_box_new() instead gtk_[v|h]box_new()
[~andy/gtk] / tests / testtreecolumns.c
index 1018f4ccfbced5186e4e3d07b9eca203611d283c..a0f6841b7a5d8a7cf9a353323279916549bdc7b5 100644 (file)
@@ -1,4 +1,24 @@
-#include <config.h>
+/* testtreecolumns.c
+ * Copyright (C) 2001 Red Hat, Inc
+ * Author: Jonathan Blandford
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
 #include <gtk/gtk.h>
 
 /*
@@ -354,7 +374,7 @@ view_column_model_get_type (void)
 
   if (!view_column_model_type)
     {
-      static const GTypeInfo view_column_model_info =
+      const GTypeInfo view_column_model_info =
       {
        sizeof (GtkListStoreClass),
        NULL,           /* base_init */
@@ -367,21 +387,21 @@ view_column_model_get_type (void)
         (GInstanceInitFunc) view_column_model_init,
       };
 
-      static const GInterfaceInfo tree_model_info =
+      const GInterfaceInfo tree_model_info =
       {
        (GInterfaceInitFunc) view_column_model_tree_model_init,
        NULL,
        NULL
       };
 
-      static const GInterfaceInfo drag_source_info =
+      const GInterfaceInfo drag_source_info =
       {
        (GInterfaceInitFunc) view_column_model_drag_source_init,
        NULL,
        NULL
       };
 
-      static const GInterfaceInfo drag_dest_info =
+      const GInterfaceInfo drag_dest_info =
       {
        (GInterfaceInitFunc) view_column_model_drag_dest_init,
        NULL,
@@ -512,7 +532,7 @@ view_column_model_new (GtkTreeView *view)
 {
   GtkTreeModel *retval;
 
-  retval = GTK_TREE_MODEL (g_object_new (view_column_model_get_type (), NULL));
+  retval = g_object_new (view_column_model_get_type (), NULL);
   ((ViewColumnModel *)retval)->view = view;
   ((ViewColumnModel *)retval)->columns = gtk_tree_view_get_columns (view);
 
@@ -792,11 +812,11 @@ main (int argc, char *argv[])
   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), 500, 300);
-  vbox = gtk_vbox_new (FALSE, 8);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 8);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
   gtk_container_add (GTK_CONTAINER (window), vbox);
 
-  hbox = gtk_hbox_new (FALSE, 8);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 8);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
 
   /* Left Pane */
@@ -817,10 +837,10 @@ main (int argc, char *argv[])
   gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0);
 
   /* Middle Pane */
-  vbox2 = gtk_vbox_new (FALSE, 8);
+  vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 8);
   gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
   
-  bbox = gtk_vbutton_box_new ();
+  bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
   gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
   gtk_box_pack_start (GTK_BOX (vbox2), bbox, TRUE, TRUE, 0);
 
@@ -838,7 +858,7 @@ main (int argc, char *argv[])
                     "changed", G_CALLBACK (selection_changed), button);
   gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
 
-  bbox = gtk_vbutton_box_new ();
+  bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
   gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
   gtk_box_pack_start (GTK_BOX (vbox2), bbox, TRUE, TRUE, 0);
 
@@ -858,7 +878,7 @@ main (int argc, char *argv[])
 
   
   /* Right Pane */
-  vbox2 = gtk_vbox_new (FALSE, 8);
+  vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 8);
   gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
 
   swindow = gtk_scrolled_window_new (NULL, NULL);
@@ -923,9 +943,10 @@ main (int argc, char *argv[])
                                        GDK_ACTION_MOVE);
 
 
-  gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL),
+                      FALSE, FALSE, 0);
 
-  hbox = gtk_hbox_new (FALSE, 8);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 8);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
   button = gtk_button_new_with_mnemonic ("_Add new Column");
   g_signal_connect (button, "clicked", G_CALLBACK (add_clicked), left_tree_model);