summaryrefslogtreecommitdiff
path: root/tests/testscrolledwindow.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/testscrolledwindow.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/testscrolledwindow.c')
-rw-r--r--tests/testscrolledwindow.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c
index c6b6ebf12b..c485a3148c 100644
--- a/tests/testscrolledwindow.c
+++ b/tests/testscrolledwindow.c
@@ -84,11 +84,11 @@ scrollable_policy (void)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_window_set_child (GTK_WINDOW (window), hbox);
- gtk_container_add (GTK_CONTAINER (hbox), vbox);
+ gtk_box_append (GTK_BOX (hbox), vbox);
frame = gtk_frame_new ("Scrolled Window");
gtk_widget_set_hexpand (frame, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), frame);
+ gtk_box_append (GTK_BOX (hbox), frame);
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
@@ -117,14 +117,14 @@ scrollable_policy (void)
gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE);
cntl = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_expander_set_child (GTK_EXPANDER (expander), cntl);
- gtk_container_add (GTK_CONTAINER (vbox), expander);
+ gtk_box_append (GTK_BOX (vbox), expander);
/* Add Horizontal policy control here */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
widget = gtk_label_new ("hscroll-policy");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Minimum");
@@ -132,8 +132,8 @@ scrollable_policy (void)
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
- gtk_container_add (GTK_CONTAINER (cntl), hbox);
+ gtk_box_append (GTK_BOX (hbox), widget);
+ gtk_box_append (GTK_BOX (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (horizontal_policy_changed), viewport);
@@ -143,7 +143,7 @@ scrollable_policy (void)
widget = gtk_label_new ("vscroll-policy");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Minimum");
@@ -151,8 +151,8 @@ scrollable_policy (void)
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
- gtk_container_add (GTK_CONTAINER (cntl), hbox);
+ gtk_box_append (GTK_BOX (hbox), widget);
+ gtk_box_append (GTK_BOX (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (vertical_policy_changed), viewport);
@@ -162,12 +162,12 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-width");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
- gtk_container_add (GTK_CONTAINER (cntl), hbox);
+ gtk_box_append (GTK_BOX (hbox), widget);
+ gtk_box_append (GTK_BOX (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (content_width_changed), swindow);
@@ -176,12 +176,12 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-height");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
- gtk_container_add (GTK_CONTAINER (cntl), hbox);
+ gtk_box_append (GTK_BOX (hbox), widget);
+ gtk_box_append (GTK_BOX (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (content_height_changed), swindow);
@@ -189,7 +189,7 @@ scrollable_policy (void)
/* Add Kinetic scrolling control here */
widget = gtk_check_button_new_with_label ("Kinetic scrolling");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (cntl), widget);
+ gtk_box_append (GTK_BOX (cntl), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (kinetic_scrolling_changed), swindow);
@@ -201,7 +201,7 @@ scrollable_policy (void)
widget = gtk_menu_button_new ();
gtk_menu_button_set_popover (GTK_MENU_BUTTON (widget), popover);
gtk_menu_button_set_label (GTK_MENU_BUTTON (widget), "Popover");
- gtk_container_add (GTK_CONTAINER (cntl), widget);
+ gtk_box_append (GTK_BOX (cntl), widget);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_popover_set_child (GTK_POPOVER (popover), vbox);
@@ -211,7 +211,7 @@ scrollable_policy (void)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (vbox), swindow);
+ gtk_box_append (GTK_BOX (vbox), swindow);
/* Listbox */
listbox = gtk_list_box_new ();
@@ -222,11 +222,11 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-width");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_spin_button_new_with_range (0.0, 150.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -236,13 +236,13 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-height");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_spin_button_new_with_range (0.0, 150.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (hbox), widget);
+ gtk_box_append (GTK_BOX (vbox), hbox);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -255,11 +255,11 @@ scrollable_policy (void)
widget = gtk_label_new ("max-content-width");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_spin_button_new_with_range (250.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -269,12 +269,12 @@ scrollable_policy (void)
widget = gtk_label_new ("max-content-height");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
widget = gtk_spin_button_new_with_range (250.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (hbox), widget);
+ gtk_box_append (GTK_BOX (vbox), hbox);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -287,15 +287,15 @@ scrollable_policy (void)
widget = gtk_button_new_with_label ("Remove");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_box_append (GTK_BOX (hbox), widget);
g_signal_connect (widget, "clicked",
G_CALLBACK (remove_row), listbox);
widget = gtk_button_new_with_label ("Add");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_container_add (GTK_CONTAINER (hbox), widget);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
+ gtk_box_append (GTK_BOX (hbox), widget);
+ gtk_box_append (GTK_BOX (vbox), hbox);
g_signal_connect (widget, "clicked",
G_CALLBACK (add_row), listbox);