summaryrefslogtreecommitdiff
path: root/tests/testcellarea.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-12-26 08:20:34 +0100
committerMatthias Clasen <mclasen@redhat.com>2019-01-23 19:30:46 -0500
commitbd71e744d2e5dbd853f0c719dd3ebe6abb2f72b6 (patch)
tree6478bd038c42a535caacf65f948892a9d0dfe5e9 /tests/testcellarea.c
parent09361e76659bd1951a222cd64537abacc6a6f44a (diff)
downloadgtk+-bd71e744d2e5dbd853f0c719dd3ebe6abb2f72b6.tar.gz
Stop using gtk_box_pack_end
It might soon go away!
Diffstat (limited to 'tests/testcellarea.c')
-rw-r--r--tests/testcellarea.c61
1 files changed, 28 insertions, 33 deletions
diff --git a/tests/testcellarea.c b/tests/testcellarea.c
index 04cba161cc..4f78f45475 100644
--- a/tests/testcellarea.c
+++ b/tests/testcellarea.c
@@ -195,20 +195,18 @@ simple_cell_area (void)
gtk_container_add (GTK_CONTAINER (frame), iconview);
-
- gtk_box_pack_end (GTK_BOX (hbox), frame);
-
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
- gtk_widget_show (vbox);
- gtk_box_pack_end (GTK_BOX (hbox), vbox);
+ gtk_container_add (GTK_CONTAINER (hbox), vbox);
+
+ gtk_container_add (GTK_CONTAINER (hbox), frame);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), iconview);
@@ -216,7 +214,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Align 2nd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (align_cell_2_toggled), iconview);
@@ -224,7 +222,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Align 3rd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (align_cell_3_toggled), iconview);
@@ -233,7 +231,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Expand 1st Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (expand_cell_1_toggled), iconview);
@@ -241,7 +239,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Expand 2nd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (expand_cell_2_toggled), iconview);
@@ -249,7 +247,7 @@ simple_cell_area (void)
widget = gtk_check_button_new_with_label ("Expand 3rd Cell");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (expand_cell_3_toggled), iconview);
@@ -441,19 +439,17 @@ focus_cell_area (void)
gtk_container_add (GTK_CONTAINER (frame), iconview);
- gtk_box_pack_end (GTK_BOX (hbox), frame);
-
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
- gtk_widget_show (vbox);
- gtk_box_pack_end (GTK_BOX (hbox), vbox);
+ gtk_container_add (GTK_CONTAINER (hbox), vbox);
+ gtk_container_add (GTK_CONTAINER (hbox), frame);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), iconview);
@@ -461,7 +457,7 @@ focus_cell_area (void)
widget = gtk_check_button_new_with_label ("Focus Sibling");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (focus_sibling_toggled), iconview);
@@ -530,8 +526,7 @@ background_area (void)
"prepended space distributed to the background area.");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 40);
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (main_vbox), label);
+ gtk_container_add (GTK_CONTAINER (main_vbox), label);
iconview = focus_iconview (TRUE, NULL, NULL);
@@ -543,20 +538,20 @@ background_area (void)
gtk_container_add (GTK_CONTAINER (frame), iconview);
- gtk_box_pack_end (GTK_BOX (hbox), frame);
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
- gtk_widget_show (vbox);
- gtk_box_pack_end (GTK_BOX (hbox), vbox);
- gtk_box_pack_start (GTK_BOX (main_vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), vbox);
+ gtk_container_add (GTK_CONTAINER (hbox), frame);
+
+ gtk_container_add (GTK_CONTAINER (main_vbox), hbox);
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Horizontal");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
- gtk_box_pack_start (GTK_BOX (vbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), widget);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), iconview);
@@ -565,9 +560,9 @@ background_area (void)
label = gtk_label_new ("Cell spacing");
gtk_widget_set_hexpand (label, TRUE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (hbox), label);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), label);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (cell_spacing_changed), iconview);
@@ -578,9 +573,9 @@ background_area (void)
label = gtk_label_new ("Row spacing");
gtk_widget_set_hexpand (label, TRUE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (hbox), label);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), label);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (row_spacing_changed), iconview);
@@ -590,9 +585,9 @@ background_area (void)
gtk_widget_set_hexpand (label, TRUE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), gtk_icon_view_get_item_padding (GTK_ICON_VIEW (iconview)));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (hbox), label);
- gtk_box_pack_start (GTK_BOX (hbox), widget);
- gtk_box_pack_start (GTK_BOX (vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (hbox), label);
+ gtk_container_add (GTK_CONTAINER (hbox), widget);
+ gtk_container_add (GTK_CONTAINER (vbox), hbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (item_padding_changed), iconview);