[gtk: 2/16] tests/popover: Add check box for switching autohide prop



commit 6eaeadb3b9938c6946ae579f329f7ea32266db91
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Mon Jul 22 22:26:39 2019 +0200

    tests/popover: Add check box for switching autohide prop

 tests/testpopover.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/tests/testpopover.c b/tests/testpopover.c
index 69207784f6..5eae2c0241 100644
--- a/tests/testpopover.c
+++ b/tests/testpopover.c
@@ -99,7 +99,7 @@ main (int argc, char *argv[])
   label = gtk_label_new ("");
   gtk_widget_set_hexpand (label, TRUE);
   gtk_widget_set_vexpand (label, TRUE);
-  gtk_grid_attach (GTK_GRID (grid), label, 3, 6, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), label, 3, 7, 1, 1);
 
   builder = gtk_builder_new_from_file ("popover.ui");
   model = (GMenuModel *)gtk_builder_get_object (builder, "menu");
@@ -142,6 +142,16 @@ main (int argc, char *argv[])
   gtk_grid_attach (GTK_GRID (grid), label , 1, 2, 1, 1);
   gtk_grid_attach (GTK_GRID (grid), check, 2, 2, 1, 1);
 
+
+  label = gtk_label_new ("Autohide");
+  check = gtk_check_button_new ();
+  g_object_bind_property (check, "active", popover, "autohide", G_BINDING_SYNC_CREATE);
+  g_object_bind_property (check, "active", popover1, "autohide", G_BINDING_SYNC_CREATE);
+  g_object_bind_property (check, "active", popover2, "autohide", G_BINDING_SYNC_CREATE);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
+  gtk_grid_attach (GTK_GRID (grid), label , 1, 3, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), check, 2, 3, 1, 1);
+
   label = gtk_label_new ("Button direction");
   combo = gtk_combo_box_text_new ();
   gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "up", "Up");
@@ -152,8 +162,8 @@ main (int argc, char *argv[])
   g_object_bind_property (combo, "active", button, "direction", G_BINDING_SYNC_CREATE);
   g_object_bind_property (combo, "active", button1, "direction", G_BINDING_SYNC_CREATE);
   g_object_bind_property (combo, "active", button2, "direction", G_BINDING_SYNC_CREATE);
-  gtk_grid_attach (GTK_GRID (grid), label , 1, 3, 1, 1);
-  gtk_grid_attach (GTK_GRID (grid), combo, 2, 3, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), label , 1, 4, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), combo, 2, 4, 1, 1);
 
   label = gtk_label_new ("Button halign");
   combo = gtk_combo_box_text_new ();
@@ -163,8 +173,8 @@ main (int argc, char *argv[])
   gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "center", "Center");
   gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 2);
   g_object_bind_property (combo, "active", box, "halign", G_BINDING_SYNC_CREATE);
-  gtk_grid_attach (GTK_GRID (grid), label , 1, 4, 1, 1);
-  gtk_grid_attach (GTK_GRID (grid), combo, 2, 4, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), label , 1, 5, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), combo, 2, 5, 1, 1);
 
   label = gtk_label_new ("Button valign");
   combo = gtk_combo_box_text_new ();
@@ -174,8 +184,8 @@ main (int argc, char *argv[])
   gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "center", "Center");
   gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 1);
   g_object_bind_property (combo, "active", box, "valign", G_BINDING_SYNC_CREATE);
-  gtk_grid_attach (GTK_GRID (grid), label , 1, 5, 1, 1);
-  gtk_grid_attach (GTK_GRID (grid), combo, 2, 5, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), label , 1, 6, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), combo, 2, 6, 1, 1);
   g_object_unref (builder);
 
 


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