summaryrefslogtreecommitdiff
path: root/tests/testscrolledwindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testscrolledwindow.c')
-rw-r--r--tests/testscrolledwindow.c64
1 files changed, 31 insertions, 33 deletions
diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c
index ac03387938..530dd0b1a9 100644
--- a/tests/testscrolledwindow.c
+++ b/tests/testscrolledwindow.c
@@ -90,11 +90,11 @@ scrollable_policy (void)
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (window), hbox);
- gtk_box_pack_start (GTK_BOX (hbox), vbox);
+ gtk_container_add (GTK_CONTAINER (hbox), vbox);
frame = gtk_frame_new ("Scrolled Window");
gtk_widget_set_hexpand (frame, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), frame);
+ gtk_container_add (GTK_CONTAINER (hbox), frame);
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
@@ -128,7 +128,7 @@ scrollable_policy (void)
gtk_widget_show (cntl);
gtk_widget_show (expander);
gtk_container_add (GTK_CONTAINER (expander), cntl);
- gtk_box_pack_start (GTK_BOX (vbox), expander);
+ gtk_container_add (GTK_CONTAINER (vbox), expander);
/* Add Horizontal policy control here */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
@@ -136,7 +136,7 @@ scrollable_policy (void)
widget = gtk_label_new ("hscroll-policy");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Minimum");
@@ -144,8 +144,8 @@ scrollable_policy (void)
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (cntl), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (horizontal_policy_changed), viewport);
@@ -156,7 +156,7 @@ scrollable_policy (void)
widget = gtk_label_new ("vscroll-policy");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Minimum");
@@ -164,8 +164,8 @@ scrollable_policy (void)
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (cntl), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (cntl), hbox);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (vertical_policy_changed), viewport);
@@ -175,12 +175,12 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-width");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (cntl), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (cntl), hbox);
gtk_widget_show (widget);
gtk_widget_show (hbox);
@@ -191,12 +191,12 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-height");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (cntl), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (cntl), hbox);
gtk_widget_show (widget);
gtk_widget_show (hbox);
@@ -206,7 +206,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_box_pack_start (GTK_BOX (cntl), widget);
+ gtk_container_add (GTK_CONTAINER (cntl), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (kinetic_scrolling_changed), swindow);
@@ -218,7 +218,7 @@ scrollable_policy (void)
widget = gtk_menu_button_new ();
gtk_menu_button_set_popover (GTK_MENU_BUTTON (widget), popover);
gtk_container_add (GTK_CONTAINER (widget), gtk_label_new ("Popover"));
- gtk_box_pack_start (GTK_BOX (cntl), widget);
+ gtk_container_add (GTK_CONTAINER (cntl), widget);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (popover), vbox);
@@ -228,9 +228,7 @@ scrollable_policy (void)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_box_pack_end (GTK_BOX (vbox), swindow);
- gtk_widget_show (swindow);
- gtk_widget_show (hbox);
+ gtk_container_add (GTK_CONTAINER (vbox), swindow);
/* Listbox */
listbox = gtk_list_box_new ();
@@ -242,11 +240,11 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-width");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (0.0, 150.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -256,13 +254,13 @@ scrollable_policy (void)
widget = gtk_label_new ("min-content-height");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (0.0, 150.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -275,11 +273,11 @@ scrollable_policy (void)
widget = gtk_label_new ("max-content-width");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (250.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -289,12 +287,12 @@ scrollable_policy (void)
widget = gtk_label_new ("max-content-height");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
widget = gtk_spin_button_new_with_range (250.0, 1000.0, 10.0);
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_object_bind_property (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)),
"value",
@@ -307,15 +305,15 @@ scrollable_policy (void)
widget = gtk_button_new_with_label ("Remove");
gtk_widget_set_hexpand (widget, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (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_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (widget, "clicked",
G_CALLBACK (add_row), listbox);