summaryrefslogtreecommitdiff
path: root/tests/testswitch.c
diff options
context:
space:
mode:
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 0b7a13283f..9d9ded6d45 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_box_pack_start (GTK_BOX (hbox), sw);
+ gtk_container_add (GTK_CONTAINER (hbox), sw);
gtk_widget_set_sensitive (sw, is_sensitive);
label = gtk_label_new (is_on ? "Enabled" : "Disabled");
gtk_widget_set_hexpand (label, TRUE);
- gtk_box_pack_end (GTK_BOX (hbox), label);
+ gtk_container_add (GTK_CONTAINER (hbox), label);
g_object_bind_property_full (sw, "active",
label, "label",
@@ -116,24 +116,18 @@ make_delayed_switch (gboolean is_on,
sw = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (sw), is_on);
- gtk_box_pack_start (GTK_BOX (hbox), sw);
+ gtk_container_add (GTK_CONTAINER (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_box_pack_start (GTK_BOX (hbox), spinner);
+ gtk_container_add (GTK_CONTAINER (hbox), spinner);
gtk_widget_set_opacity (spinner, 0.0);
- check = gtk_check_button_new ();
- gtk_box_pack_end (GTK_BOX (hbox), check);
- g_object_bind_property (sw, "state",
- check, "active",
- G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
-
label = gtk_label_new (is_on ? "Enabled" : "Disabled");
gtk_widget_set_hexpand (label, TRUE);
- gtk_box_pack_end (GTK_BOX (hbox), label);
+ gtk_container_add (GTK_CONTAINER (hbox), label);
g_object_bind_property_full (sw, "active",
label, "label",
@@ -142,6 +136,12 @@ make_delayed_switch (gboolean is_on,
NULL,
NULL, NULL);
+ check = gtk_check_button_new ();
+ gtk_container_add (GTK_CONTAINER (hbox), check);
+ g_object_bind_property (sw, "state",
+ check, "active",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+
g_signal_connect (sw, "notify", G_CALLBACK (sw_delay_notify), spinner);
return hbox;