]> Pileus Git - ~andy/gtk/blobdiff - tests/testmerge.c
Merge branch 'master' into treeview-refactor
[~andy/gtk] / tests / testmerge.c
index 7a2654d7302da513e38a27346f8a5bb9318436db..1e43bb818b1999c2e2420e814c14f3ba6edbca50 100644 (file)
@@ -1,4 +1,23 @@
-#include <config.h>
+/* testmerge.c
+ * Copyright (C) 2003 James Henstridge
+ *
+ * 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 <stdio.h>
 #include <string.h>
@@ -24,7 +43,7 @@ dump_tree (GtkWidget    *button,
   gchar *dump;
 
   dump = gtk_ui_manager_get_ui (merge);
-  g_message (dump);
+  g_message ("%s", dump);
   g_free (dump);
 }
 
@@ -121,7 +140,7 @@ static void
 toggle_dynamic (GtkWidget    *button, 
                GtkUIManager *merge)
 {
-  g_timeout_add (2000, (GSourceFunc)delayed_toggle_dynamic, merge);
+  gdk_threads_add_timeout (2000, (GSourceFunc)delayed_toggle_dynamic, merge);
 }
 
 static void
@@ -245,7 +264,7 @@ toggle_merge (GtkWidget    *button,
                                           "could not merge %s: %s", merge_ids[mergenum].filename,
                                           err->message);
 
-         g_signal_connect (dialog, "response", G_CALLBACK (gtk_object_destroy), NULL);
+         g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
          gtk_widget_show (dialog);
 
          g_clear_error (&err);
@@ -409,6 +428,8 @@ create_tree_view (GtkUIManager *merge)
          gtk_list_store_append (store, &iter);
          gtk_list_store_set (store, &iter, 0, l->data, -1);
        }
+
+      g_list_free (actions);
     }
   
   tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
@@ -605,7 +626,7 @@ main (int argc, char **argv)
   gtk_table_attach (GTK_TABLE (table), frame, 0,2, 1,2,
                    GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
   
-  menu_box = gtk_vbox_new (FALSE, 0);
+  menu_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_container_set_border_width (GTK_CONTAINER (menu_box), 2);
   gtk_container_add (GTK_CONTAINER (frame), menu_box);
 
@@ -620,14 +641,15 @@ main (int argc, char **argv)
 
   button = gtk_button_new ();
   gtk_box_pack_end (GTK_BOX (menu_box), button, FALSE, FALSE, 0);
-  gtk_action_connect_proxy (gtk_action_group_get_action (action_group, "AboutAction"), 
-                           button);
+  gtk_activatable_set_related_action (GTK_ACTIVATABLE (button),
+                           gtk_action_group_get_action (action_group, "AboutAction"));
+
   gtk_widget_show (button);
 
   button = gtk_check_button_new ();
   gtk_box_pack_end (GTK_BOX (menu_box), button, FALSE, FALSE, 0);
-  gtk_action_connect_proxy (gtk_action_group_get_action (action_group, "BoldAction"), 
-                           button);
+  gtk_activatable_set_related_action (GTK_ACTIVATABLE (button),
+                           gtk_action_group_get_action (action_group, "BoldAction"));
   gtk_widget_show (button);
 
   merge = gtk_ui_manager_new ();
@@ -645,7 +667,7 @@ main (int argc, char **argv)
   gtk_table_attach (GTK_TABLE (table), frame, 0,1, 0,1,
                    GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
 
-  vbox = gtk_vbox_new (FALSE, 2);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
   gtk_container_add (GTK_CONTAINER (frame), vbox);