[gtk/wip/exalm/test: 27/37] tests: Simplify testorientable



commit 14dc92c747ef275bedab4c80c11b0025550abc6d
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon May 11 19:08:56 2020 +0500

    tests: Simplify testorientable
    
    Since GtkButtonBox is gone, remove the separator and change grid to box.

 tests/testorientable.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/tests/testorientable.c b/tests/testorientable.c
index 0ffa5b184c..2413be638f 100644
--- a/tests/testorientable.c
+++ b/tests/testorientable.c
@@ -58,7 +58,7 @@ int
 main (int argc, char **argv)
 {
   GtkWidget *window;
-  GtkWidget *grid;
+  GtkWidget *vbox;
   GtkWidget *box, *button;
   GList *orientables = NULL;
   gboolean done = FALSE;
@@ -66,14 +66,15 @@ main (int argc, char **argv)
   gtk_init ();
 
   window = gtk_window_new ();
-  grid= gtk_grid_new ();
-  gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
-  gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+
+  button = gtk_toggle_button_new_with_label ("Horizontal");
+  gtk_container_add (GTK_CONTAINER (vbox), button);
 
   /* GtkBox */
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   orientables = g_list_prepend (orientables, box);
-  gtk_grid_attach (GTK_GRID (grid), box, 0, 1, 1, 1);
+  gtk_container_add (GTK_CONTAINER (vbox), box);
   gtk_container_add (GTK_CONTAINER (box),
                   gtk_button_new_with_label ("GtkBox 1"));
   gtk_container_add (GTK_CONTAINER (box),
@@ -81,17 +82,10 @@ main (int argc, char **argv)
   gtk_container_add (GTK_CONTAINER (box),
                   gtk_button_new_with_label ("GtkBox 3"));
 
-  /* GtkSeparator */
-  box = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
-  orientables = g_list_prepend (orientables, box);
-  gtk_grid_attach (GTK_GRID (grid), box, 2, 1, 1, 1);
-
-  button = gtk_toggle_button_new_with_label ("Horizontal");
-  gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1);
   g_signal_connect (button, "toggled",
                   G_CALLBACK (orient_toggled), orientables);
 
-  gtk_window_set_child (GTK_WINDOW (window), grid);
+  gtk_window_set_child (GTK_WINDOW (window), vbox);
   gtk_widget_show (window);
 
   g_signal_connect (window, "destroy",


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