summaryrefslogtreecommitdiff
path: root/tests/testswitch.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-09 08:26:52 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-11 22:38:21 -0400
commit2a24b8c6534b58051135570399cba8a6b04d34ea (patch)
treec3b4690ed396ab2b2ca162641bd2008d0bd7630e /tests/testswitch.c
parent665edcba53bf2f2e854a95cdcc52a72c16a1a427 (diff)
downloadgtk+-2a24b8c6534b58051135570399cba8a6b04d34ea.tar.gz
Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
Diffstat (limited to 'tests/testswitch.c')
-rw-r--r--tests/testswitch.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/testswitch.c b/tests/testswitch.c
index 0a3644ab6b..015700d1f4 100644
--- a/tests/testswitch.c
+++ b/tests/testswitch.c
@@ -26,12 +26,12 @@ make_switch (gboolean is_on,
sw = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (sw), is_on);
- gtk_container_add (GTK_CONTAINER (hbox), sw);
+ gtk_box_append (GTK_BOX (hbox), sw);
gtk_widget_set_sensitive (sw, is_sensitive);
label = gtk_label_new (is_on ? "Enabled" : "Disabled");
gtk_widget_set_hexpand (label, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), label);
+ gtk_box_append (GTK_BOX (hbox), label);
g_object_bind_property_full (sw, "active",
label, "label",
@@ -116,18 +116,18 @@ make_delayed_switch (gboolean is_on,
sw = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (sw), is_on);
- gtk_container_add (GTK_CONTAINER (hbox), sw);
+ gtk_box_append (GTK_BOX (hbox), sw);
gtk_widget_set_sensitive (sw, is_sensitive);
g_signal_connect (sw, "state-set", G_CALLBACK (set_state), NULL);
spinner = gtk_spinner_new ();
- gtk_container_add (GTK_CONTAINER (hbox), spinner);
+ gtk_box_append (GTK_BOX (hbox), spinner);
gtk_widget_set_opacity (spinner, 0.0);
label = gtk_label_new (is_on ? "Enabled" : "Disabled");
gtk_widget_set_hexpand (label, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), label);
+ gtk_box_append (GTK_BOX (hbox), label);
g_object_bind_property_full (sw, "active",
label, "label",
@@ -137,7 +137,7 @@ make_delayed_switch (gboolean is_on,
NULL, NULL);
check = gtk_check_button_new ();
- gtk_container_add (GTK_CONTAINER (hbox), check);
+ gtk_box_append (GTK_BOX (hbox), check);
g_object_bind_property (sw, "state",
check, "active",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
@@ -176,19 +176,19 @@ int main (int argc, char *argv[])
gtk_window_set_child (GTK_WINDOW (window), vbox);
hbox = make_switch (FALSE, TRUE);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (vbox), hbox);
hbox = make_switch (TRUE, TRUE);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (vbox), hbox);
hbox = make_switch (FALSE, FALSE);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (vbox), hbox);
hbox = make_switch (TRUE, FALSE);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (vbox), hbox);
hbox = make_delayed_switch (FALSE, TRUE);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (vbox), hbox);
while (!done)
g_main_context_iteration (NULL, TRUE);