diff options
author | Timm Bäder <mail@baedert.org> | 2018-12-26 08:20:34 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-01-23 19:30:46 -0500 |
commit | bd71e744d2e5dbd853f0c719dd3ebe6abb2f72b6 (patch) | |
tree | 6478bd038c42a535caacf65f948892a9d0dfe5e9 /tests | |
parent | 09361e76659bd1951a222cd64537abacc6a6f44a (diff) | |
download | gtk+-bd71e744d2e5dbd853f0c719dd3ebe6abb2f72b6.tar.gz |
Stop using gtk_box_pack_end
It might soon go away!
Diffstat (limited to 'tests')
52 files changed, 726 insertions, 729 deletions
diff --git a/tests/gdkgears.c b/tests/gdkgears.c index 56b5076b13..5c25350e28 100644 --- a/tests/gdkgears.c +++ b/tests/gdkgears.c @@ -174,37 +174,40 @@ main (int argc, char *argv[]) gtk_widget_show (hbox); fps_label = gtk_label_new (""); + gtk_widget_set_hexpand (fps_label, TRUE); + gtk_widget_set_halign (fps_label, GTK_ALIGN_START); gtk_container_add (GTK_CONTAINER (hbox), fps_label); - gtk_widget_show (fps_label); gtk_gears_set_fps_label (GTK_GEARS (gears), GTK_LABEL (fps_label)); - spinner = gtk_spinner_new (); - gtk_box_pack_end (GTK_BOX (hbox), spinner); - gtk_widget_show (spinner); - gtk_spinner_start (GTK_SPINNER (spinner)); - - check = gtk_check_button_new_with_label ("Animate spinner"); - gtk_box_pack_end (GTK_BOX (hbox), check); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); - gtk_widget_show (check); - g_signal_connect (check, "toggled", - G_CALLBACK (toggle_spin), spinner); - check = gtk_check_button_new_with_label ("Overlay"); - gtk_box_pack_end (GTK_BOX (hbox), check); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE); - gtk_widget_show (check); - g_signal_connect (check, "toggled", - G_CALLBACK (toggle_overlay), revealer); button = gtk_menu_button_new (); gtk_menu_button_set_direction (GTK_MENU_BUTTON (button), GTK_ARROW_UP); popover = gtk_popover_new (NULL); label = gtk_label_new ("Popovers work too!"); - gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (popover), label); + gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), popover); - gtk_widget_show (button); - gtk_box_pack_end (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); + + check = gtk_check_button_new_with_label ("Overlay"); + gtk_container_add (GTK_CONTAINER (hbox), check); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE); + g_signal_connect (check, "toggled", + G_CALLBACK (toggle_overlay), revealer); + + + + check = gtk_check_button_new_with_label ("Animate spinner"); + gtk_container_add (GTK_CONTAINER (hbox), check); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); + + + spinner = gtk_spinner_new (); + gtk_container_add (GTK_CONTAINER (hbox), spinner); + gtk_spinner_start (GTK_SPINNER (spinner)); + g_signal_connect (check, "toggled", + G_CALLBACK (toggle_spin), spinner); + scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), diff --git a/tests/motion-compression.c b/tests/motion-compression.c index 65e1ca5e8e..d69716e5f3 100644 --- a/tests/motion-compression.c +++ b/tests/motion-compression.c @@ -52,18 +52,18 @@ main (int argc, char **argv) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); - adjustment = gtk_adjustment_new (20, 0, 200, 1, 10, 0); - scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment); - gtk_box_pack_end (GTK_BOX (vbox), scale); + da = gtk_drawing_area_new (); + gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), on_draw, NULL, NULL); + gtk_widget_set_vexpand (da, TRUE); + gtk_container_add (GTK_CONTAINER (vbox), da); label = gtk_label_new ("Event processing time (ms):"); gtk_widget_set_halign (label, GTK_ALIGN_CENTER); - gtk_box_pack_end (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); - da = gtk_drawing_area_new (); - gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), on_draw, NULL, NULL); - gtk_widget_set_vexpand (da, TRUE); - gtk_box_pack_end (GTK_BOX (vbox), da); + adjustment = gtk_adjustment_new (20, 0, 200, 1, 10, 0); + scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment); + gtk_container_add (GTK_CONTAINER (vbox), scale); controller = gtk_event_controller_motion_new (); g_signal_connect (controller, "motion", diff --git a/tests/overlayscroll.c b/tests/overlayscroll.c index 92db4c4d78..64f3279351 100644 --- a/tests/overlayscroll.c +++ b/tests/overlayscroll.c @@ -65,7 +65,7 @@ main (int argc, char *argv[]) GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_box_pack_start (GTK_BOX (box), sw); + gtk_container_add (GTK_CONTAINER (box), sw); content = get_content (); diff --git a/tests/print-editor.c b/tests/print-editor.c index 6af459d3c7..f43f1a495f 100644 --- a/tests/print-editor.c +++ b/tests/print-editor.c @@ -321,15 +321,15 @@ create_custom_widget (GtkPrintOperation *operation, vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); gtk_widget_show (hbox); label = gtk_label_new ("Font:"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); gtk_widget_show (label); font = gtk_font_button_new_with_font (data->font); - gtk_box_pack_start (GTK_BOX (hbox), font); + gtk_container_add (GTK_CONTAINER (hbox), font); gtk_widget_show (font); data->font_button = font; diff --git a/tests/syncscroll.c b/tests/syncscroll.c index b0c4b4f33f..9229ff9aea 100644 --- a/tests/syncscroll.c +++ b/tests/syncscroll.c @@ -32,7 +32,7 @@ main (int argc, char *argv[]) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_EXTERNAL); - gtk_box_pack_start (GTK_BOX (box), sw); + gtk_container_add (GTK_CONTAINER (box), sw); tv = gtk_text_view_new (); fill_text_view (tv, "Left"); gtk_container_add (GTK_CONTAINER (sw), tv); @@ -43,7 +43,7 @@ main (int argc, char *argv[]) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_EXTERNAL); - gtk_box_pack_start (GTK_BOX (box), sw); + gtk_container_add (GTK_CONTAINER (box), sw); tv = gtk_text_view_new (); fill_text_view (tv, "Middle"); gtk_container_add (GTK_CONTAINER (sw), tv); @@ -52,7 +52,7 @@ main (int argc, char *argv[]) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_EXTERNAL); - gtk_box_pack_start (GTK_BOX (box), sw); + gtk_container_add (GTK_CONTAINER (box), sw); tv = gtk_text_view_new (); fill_text_view (tv, "Right"); gtk_container_add (GTK_CONTAINER (sw), tv); diff --git a/tests/testaccel.c b/tests/testaccel.c index 7023e6a57f..0cc7d1600b 100644 --- a/tests/testaccel.c +++ b/tests/testaccel.c @@ -75,7 +75,7 @@ key_test (void) box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); gtk_widget_show (box); gtk_container_add (GTK_CONTAINER (window), box); - gtk_box_pack_start (GTK_BOX (box), sw); + gtk_container_add (GTK_CONTAINER (box), sw); store = gtk_list_store_new (3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_UINT); tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); diff --git a/tests/testactionbar.c b/tests/testactionbar.c index bd34bef129..567c711fba 100644 --- a/tests/testactionbar.c +++ b/tests/testactionbar.c @@ -116,8 +116,9 @@ activate (GApplication *gapp) "margin", 20, "row-spacing", 12, "column-spacing", 12, + "vexpand", TRUE, NULL); - gtk_box_pack_start (GTK_BOX (box), grid); + gtk_container_add (GTK_CONTAINER (box), grid); label = gtk_label_new ("Start"); gtk_widget_set_halign (label, GTK_ALIGN_END); @@ -151,7 +152,7 @@ activate (GApplication *gapp) gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1); gtk_grid_attach (GTK_GRID (grid), check, 1, 3, 1, 1); - gtk_box_pack_end (GTK_BOX (box), bar); + gtk_container_add (GTK_CONTAINER (box), bar); gtk_container_add (GTK_CONTAINER (window), box); gtk_widget_show (window); } diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c index 76abf27219..40e5e22cc2 100644 --- a/tests/testadjustsize.c +++ b/tests/testadjustsize.c @@ -325,7 +325,7 @@ open_valigned_label_window (void) label = gtk_label_new ("Both labels expand"); gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (box), label); + gtk_container_add (GTK_CONTAINER (box), label); label = gtk_label_new ("Some wrapping text with width-chars = 15 and max-width-chars = 35"); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); @@ -341,7 +341,7 @@ open_valigned_label_window (void) gtk_widget_set_valign (frame, GTK_ALIGN_CENTER); gtk_widget_set_halign (frame, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); gtk_window_present (GTK_WINDOW (window)); } diff --git a/tests/testappchooserbutton.c b/tests/testappchooserbutton.c index ea236024d9..6aee3dad6d 100644 --- a/tests/testappchooserbutton.c +++ b/tests/testappchooserbutton.c @@ -74,22 +74,22 @@ main (int argc, gtk_container_add (GTK_CONTAINER (toplevel), box); button = gtk_app_chooser_button_new ("image/jpeg"); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); g_signal_connect (button, "changed", G_CALLBACK (combo_changed_cb), NULL); w = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (w), "<b>Selected app info</b>"); - gtk_box_pack_start (GTK_BOX (box), w); + gtk_container_add (GTK_CONTAINER (box), w); w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - gtk_box_pack_start (GTK_BOX (box), w); + gtk_container_add (GTK_CONTAINER (box), w); sel_image = gtk_image_new (); - gtk_box_pack_start (GTK_BOX (w), sel_image); + gtk_container_add (GTK_CONTAINER (w), sel_image); sel_name = gtk_label_new (NULL); - gtk_box_pack_start (GTK_BOX (w), sel_name); + gtk_container_add (GTK_CONTAINER (w), sel_name); gtk_app_chooser_button_set_heading (GTK_APP_CHOOSER_BUTTON (button), "Choose one, <i>not</i> two"); gtk_app_chooser_button_append_separator (GTK_APP_CHOOSER_BUTTON (button)); diff --git a/tests/testassistant.c b/tests/testassistant.c index 6b2ae17c04..70e02e6d13 100644 --- a/tests/testassistant.c +++ b/tests/testassistant.c @@ -377,13 +377,13 @@ create_nonlinear_assistant (GtkWidget *widget) page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); button = gtk_radio_button_new_with_label (NULL, "branch A"); - gtk_box_pack_start (GTK_BOX (page), button); + gtk_container_add (GTK_CONTAINER (page), button); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (select_branch), GINT_TO_POINTER ('A')); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); button = gtk_radio_button_new_with_label (gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)), "branch B"); - gtk_box_pack_start (GTK_BOX (page), button); + gtk_container_add (GTK_CONTAINER (page), button); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (select_branch), GINT_TO_POINTER ('B')); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); @@ -648,7 +648,7 @@ create_page_flipping_assistant (GtkWidget *widget) gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, TRUE); page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (page), + gtk_container_add (GTK_CONTAINER (page), get_test_page ("Page 2")); gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Page 2"); @@ -718,7 +718,7 @@ main (int argc, gchar *argv[]) g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (buttons[i].func), NULL); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); } gtk_widget_show (window); diff --git a/tests/testbaseline.c b/tests/testbaseline.c index 9554b8a8a0..e61b649852 100644 --- a/tests/testbaseline.c +++ b/tests/testbaseline.c @@ -100,7 +100,7 @@ main (int argc, for (j = 0; j < 2; j++) { hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); char *aligns_names[] = { "FILL", "BASELINE" }; GtkAlign aligns[] = { GTK_ALIGN_FILL, GTK_ALIGN_BASELINE}; @@ -140,7 +140,7 @@ main (int argc, } grid_hbox = hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); combo = gtk_combo_box_text_new (); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), baseline_pos_str[0]); @@ -152,7 +152,7 @@ main (int argc, for (j = 0; j < 2; j++) { hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (baseline_position_changed), hbox); @@ -225,7 +225,7 @@ main (int argc, vbox, gtk_label_new ("grid")); grid_hbox = hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); label = gtk_label_new ("Align me:"); gtk_widget_set_valign (label, GTK_ALIGN_BASELINE); @@ -292,7 +292,7 @@ main (int argc, gtk_container_add (GTK_CONTAINER (hbox), grid); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); adjustment = gtk_adjustment_new (0.0, -1.0, 5.0, 1.0, 1.0, 0.0); spin = gtk_spin_button_new (adjustment, 1.0, 0); @@ -317,7 +317,7 @@ main (int argc, vbox, gtk_label_new ("button box")); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); adjustment = gtk_adjustment_new (34.0, 1.0, 64.0, 1.0, 1.0, 0.0); spin = gtk_spin_button_new (adjustment, 1.0, 0); @@ -330,7 +330,7 @@ main (int argc, for (j = 0; j < 3; j++) { hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); gtk_box_set_baseline_position (GTK_BOX (hbox), j); diff --git a/tests/testbbox.c b/tests/testbbox.c index 892691301d..f550b759fe 100644 --- a/tests/testbbox.c +++ b/tests/testbbox.c @@ -129,7 +129,7 @@ main (int argc, /* GtkHButtonBox */ hbbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (vbox), hbbox); + gtk_container_add (GTK_CONTAINER (vbox), hbbox); for (i = 0; i < N_BUTTONS; i++) { buttons[i] = gtk_button_new_with_label (strings[i]); @@ -142,27 +142,27 @@ main (int argc, /* GtkVButtonBox */ vbbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); - gtk_box_pack_start (GTK_BOX (vbox), vbbox); + gtk_container_add (GTK_CONTAINER (vbox), vbbox); /* Options */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); combo_types = gtk_combo_box_text_new (); populate_combo_with (GTK_COMBO_BOX_TEXT (combo_types), types); g_signal_connect (G_OBJECT (combo_types), "changed", G_CALLBACK (combo_types_changed_cb), buttons); - gtk_box_pack_start (GTK_BOX (hbox), combo_types); + gtk_container_add (GTK_CONTAINER (hbox), combo_types); combo_styles = gtk_combo_box_text_new (); populate_combo_with (GTK_COMBO_BOX_TEXT (combo_styles), styles); g_signal_connect (G_OBJECT (combo_styles), "changed", G_CALLBACK (combo_changed_cb), NULL); - gtk_box_pack_start (GTK_BOX (hbox), combo_styles); + gtk_container_add (GTK_CONTAINER (hbox), combo_styles); option = gtk_check_button_new_with_label ("Help is secondary"); g_signal_connect (G_OBJECT (option), "toggled", G_CALLBACK (option_cb), buttons[N_BUTTONS - 1]); - gtk_box_pack_start (GTK_BOX (hbox), option); + gtk_container_add (GTK_CONTAINER (hbox), option); gtk_widget_show (window); gtk_widget_hide (vbbox); diff --git a/tests/testbox.c b/tests/testbox.c index cb616f9866..d8510c84ac 100644 --- a/tests/testbox.c +++ b/tests/testbox.c @@ -89,12 +89,12 @@ main (int argc, char *argv[]) gtk_container_add (GTK_CONTAINER (window), vbox); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (box), test_widget ("1")); - gtk_box_pack_start (GTK_BOX (box), test_widget ("2")); - gtk_box_pack_start (GTK_BOX (box), test_widget ("3")); - gtk_box_pack_start (GTK_BOX (box), test_widget ("4")); - gtk_box_pack_end (GTK_BOX (box), test_widget ("5")); - gtk_box_pack_end (GTK_BOX (box), test_widget ("6")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("1")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("2")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("3")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("4")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("5")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("6")); gtk_container_add (GTK_CONTAINER (vbox), box); @@ -112,14 +112,14 @@ main (int argc, char *argv[]) gtk_widget_set_halign (b, GTK_ALIGN_CENTER); label = gtk_label_new ("Spacing:"); gtk_widget_set_halign (label, GTK_ALIGN_END); - gtk_box_pack_start (GTK_BOX (b), label); + gtk_container_add (GTK_CONTAINER (b), label); spin = gtk_spin_button_new_with_range (0, 10, 1); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE); gtk_widget_set_halign (spin, GTK_ALIGN_START); g_signal_connect (spin, "value-changed", G_CALLBACK (spacing_changed), box); - gtk_box_pack_start (GTK_BOX (b), spin); + gtk_container_add (GTK_CONTAINER (b), spin); gtk_container_add (GTK_CONTAINER (vbox), b); gtk_widget_show (window); diff --git a/tests/testboxcss.c b/tests/testboxcss.c index fea3bbb903..e36db2ef58 100644 --- a/tests/testboxcss.c +++ b/tests/testboxcss.c @@ -169,10 +169,10 @@ main (gint argc, gchar **argv) toolbar = gtk_toolbar_new (); gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_TEXT); - gtk_box_pack_start (GTK_BOX (main_box), toolbar); + gtk_container_add (GTK_CONTAINER (main_box), toolbar); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (main_box), box); + gtk_container_add (GTK_CONTAINER (main_box), box); container = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (container), 200); @@ -194,28 +194,30 @@ main (gint argc, gchar **argv) gtk_text_view_get_buffer (GTK_TEXT_VIEW (child))); container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (main_box), container); + gtk_container_add (GTK_CONTAINER (main_box), container); child = gtk_switch_new (); gtk_switch_set_active (GTK_SWITCH (child), gtk_widget_get_default_direction () == GTK_TEXT_DIR_LTR); g_signal_connect (child, "notify::active", G_CALLBACK (set_orientation), NULL); - gtk_box_pack_start (GTK_BOX (container), child); + gtk_container_add (GTK_CONTAINER (container), child); child = gtk_label_new ("left-to-right"); - gtk_box_pack_start (GTK_BOX (container), child); - child = gtk_button_new_with_label ("Add button"); - g_signal_connect_swapped (child, - "clicked", - G_CALLBACK (add_button), - box); - gtk_box_pack_end (GTK_BOX (container), child); + gtk_widget_set_hexpand (child, TRUE); + gtk_widget_set_halign (child, GTK_ALIGN_START); + gtk_container_add (GTK_CONTAINER (container), child); child = gtk_button_new_with_label ("Add toolbutton"); g_signal_connect_swapped (child, "clicked", G_CALLBACK (add_toolbutton), toolbar); - gtk_box_pack_end (GTK_BOX (container), child); + gtk_container_add (GTK_CONTAINER (container), child); + child = gtk_button_new_with_label ("Add button"); + g_signal_connect_swapped (child, + "clicked", + G_CALLBACK (add_button), + box); + gtk_container_add (GTK_CONTAINER (container), child); add_toolbutton (GTK_TOOLBAR (toolbar)); add_toolbutton (GTK_TOOLBAR (toolbar)); diff --git a/tests/testcalendar.c b/tests/testcalendar.c index f93bb56f7f..499d101389 100644 --- a/tests/testcalendar.c +++ b/tests/testcalendar.c @@ -491,7 +491,7 @@ create_calendar(void) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, DEF_PAD_SMALL); frame = create_frame ("<b>Options</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (rpane), frame); + gtk_container_add (GTK_CONTAINER (rpane), frame); size = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); context = gtk_widget_get_style_context (calendar); @@ -512,9 +512,9 @@ create_calendar(void) gtk_size_group_add_widget (size, label); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL); - gtk_box_pack_start (GTK_BOX (hbox), label); - gtk_box_pack_start (GTK_BOX (hbox), button); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), button); + gtk_container_add (GTK_CONTAINER (vbox), hbox); /* Build the width entry */ @@ -533,9 +533,9 @@ create_calendar(void) gtk_size_group_add_widget (size, label); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL); - gtk_box_pack_start (GTK_BOX (hbox), label); - gtk_box_pack_start (GTK_BOX (hbox), button); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), button); + gtk_container_add (GTK_CONTAINER (vbox), hbox); /* Build the height entry */ @@ -554,15 +554,15 @@ create_calendar(void) gtk_size_group_add_widget (size, label); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL); - gtk_box_pack_start (GTK_BOX (hbox), label); - gtk_box_pack_start (GTK_BOX (hbox), button); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), button); + gtk_container_add (GTK_CONTAINER (vbox), hbox); /* Build the right details frame */ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, DEF_PAD_SMALL); frame = create_frame ("<b>Details</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_FILL); - gtk_box_pack_start (GTK_BOX (rpane), frame); + gtk_container_add (GTK_CONTAINER (rpane), frame); details = gtk_text_view_new(); calendar_data.details_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (details)); @@ -580,12 +580,12 @@ create_calendar(void) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_box_pack_start (GTK_BOX (vbox), scroller); + gtk_container_add (GTK_CONTAINER (vbox), scroller); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL); gtk_widget_set_halign (hbox, GTK_ALIGN_START); gtk_widget_set_valign (hbox, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); button = gtk_button_new_with_mnemonic ("Demonstrate _Details"); @@ -594,7 +594,7 @@ create_calendar(void) G_CALLBACK (demonstrate_details), &calendar_data); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); button = gtk_button_new_with_mnemonic ("_Reset Details"); @@ -603,24 +603,24 @@ create_calendar(void) G_CALLBACK (reset_details), &calendar_data); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); toggle = gtk_check_button_new_with_mnemonic ("_Use Details"); g_signal_connect (toggle, "toggled", G_CALLBACK(calendar_toggle_details), &calendar_data); - gtk_box_pack_start (GTK_BOX (vbox), toggle); + gtk_container_add (GTK_CONTAINER (vbox), toggle); /* Build the Right frame with the flags in */ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); frame = create_expander ("<b>Flags</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (rpane), frame); + gtk_container_add (GTK_CONTAINER (rpane), frame); for (i = 0; i < G_N_ELEMENTS (calendar_data.settings); i++) { toggle = gtk_check_button_new_with_mnemonic(flags[i].label); - gtk_box_pack_start (GTK_BOX (vbox), toggle); + gtk_container_add (GTK_CONTAINER (vbox), toggle); calendar_data.flag_checkboxes[i] = toggle; g_signal_connect (toggle, "toggled", @@ -639,25 +639,25 @@ create_calendar(void) frame = create_frame ("<b>Signal Events</b>", vbox, GTK_ALIGN_FILL, GTK_ALIGN_CENTER); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); label = gtk_label_new ("Signal:"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); calendar_data.last_sig = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), calendar_data.last_sig); + gtk_container_add (GTK_CONTAINER (hbox), calendar_data.last_sig); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); label = gtk_label_new ("Previous signal:"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); calendar_data.prev_sig = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev_sig); + gtk_container_add (GTK_CONTAINER (hbox), calendar_data.prev_sig); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); label = gtk_label_new ("Second previous signal:"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); calendar_data.prev2_sig = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev2_sig); + gtk_container_add (GTK_CONTAINER (hbox), calendar_data.prev2_sig); /* * Glue everything together @@ -672,11 +672,11 @@ create_calendar(void) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, DEF_PAD_SMALL); - gtk_box_pack_start (GTK_BOX (vbox), hpaned); - gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); - gtk_box_pack_start (GTK_BOX (vbox), frame); - gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); - gtk_box_pack_start (GTK_BOX (vbox), bbox); + gtk_container_add (GTK_CONTAINER (vbox), hpaned); + gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); + gtk_container_add (GTK_CONTAINER (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); + gtk_container_add (GTK_CONTAINER (vbox), bbox); gtk_container_add (GTK_CONTAINER (window), vbox); 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); diff --git a/tests/testcellrenderertext.c b/tests/testcellrenderertext.c index ffd734f7e2..4c35f13ef8 100644 --- a/tests/testcellrenderertext.c +++ b/tests/testcellrenderertext.c @@ -266,20 +266,20 @@ main (int argc, char **argv) /* LTR */ label = gtk_label_new ("Left to right"); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); tree = create_tree (FALSE); gtk_widget_set_vexpand (tree, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), tree); + gtk_container_add (GTK_CONTAINER (vbox), tree); /* RTL */ label = gtk_label_new ("Right to left"); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); tree = create_tree (TRUE); gtk_widget_set_vexpand (tree, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), tree); + gtk_container_add (GTK_CONTAINER (vbox), tree); gtk_widget_show (window); gtk_main (); diff --git a/tests/testcombo.c b/tests/testcombo.c index e60e361d06..e369f4e48e 100644 --- a/tests/testcombo.c +++ b/tests/testcombo.c @@ -1075,7 +1075,7 @@ main (int argc, char **argv) /* GtkCellView */ tmp = gtk_frame_new ("GtkCellView"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1096,7 +1096,7 @@ main (int argc, char **argv) /* GtkComboBox list */ tmp = gtk_frame_new ("GtkComboBox (list)"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1136,7 +1136,7 @@ main (int argc, char **argv) /* GtkComboBox dynamic list */ tmp = gtk_frame_new ("GtkComboBox (dynamic list)"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1179,7 +1179,7 @@ main (int argc, char **argv) /* GtkComboBox custom entry */ tmp = gtk_frame_new ("GtkComboBox (custom)"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1233,7 +1233,7 @@ main (int argc, char **argv) /* GtkComboBox tree */ tmp = gtk_frame_new ("GtkComboBox (tree)"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1276,18 +1276,18 @@ main (int argc, char **argv) /* GtkComboBox (grid mode) */ tmp = gtk_frame_new ("GtkComboBox (grid mode)"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); comboboxgrid = create_combo_box_grid_demo (); - gtk_box_pack_start (GTK_BOX (boom), comboboxgrid); + gtk_container_add (GTK_CONTAINER (boom), comboboxgrid); /* GtkComboBoxEntry */ tmp = gtk_frame_new ("GtkComboBox with entry"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1299,7 +1299,7 @@ main (int argc, char **argv) /* Phylogenetic tree */ tmp = gtk_frame_new ("What are you ?"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1321,7 +1321,7 @@ main (int argc, char **argv) /* Capitals */ tmp = gtk_frame_new ("Where are you ?"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1352,7 +1352,7 @@ main (int argc, char **argv) /* Aligned Food */ tmp = gtk_frame_new ("Hungry ?"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1386,7 +1386,7 @@ main (int argc, char **argv) /* Ellipsizing growing combos */ tmp = gtk_frame_new ("Unconstrained Menu"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); boom = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (tmp), boom); @@ -1405,7 +1405,7 @@ main (int argc, char **argv) gtk_combo_box_set_popup_fixed_width (GTK_COMBO_BOX (combobox), FALSE); tmp = gtk_frame_new ("Looong"); - gtk_box_pack_start (GTK_BOX (mainbox), tmp); + gtk_container_add (GTK_CONTAINER (mainbox), tmp); combobox = gtk_combo_box_text_new (); for (i = 0; i < 200; i++) { diff --git a/tests/testcombochange.c b/tests/testcombochange.c index 6b13d8d163..ea52eb4943 100644 --- a/tests/testcombochange.c +++ b/tests/testcombochange.c @@ -247,30 +247,30 @@ main (int argc, char **argv) content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); - gtk_box_pack_start (GTK_BOX (content_area), hbox); + gtk_container_add (GTK_CONTAINER (content_area), hbox); combo_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (hbox), combo_vbox); + gtk_container_add (GTK_CONTAINER (hbox), combo_vbox); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "<b>Menu mode</b>"); - gtk_box_pack_start (GTK_BOX (combo_vbox), label); + gtk_container_add (GTK_CONTAINER (combo_vbox), label); menu_combo = create_combo ("menu-combo", FALSE); gtk_widget_set_margin_start (menu_combo, 12); - gtk_box_pack_start (GTK_BOX (combo_vbox), menu_combo); + gtk_container_add (GTK_CONTAINER (combo_vbox), menu_combo); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "<b>List mode</b>"); - gtk_box_pack_start (GTK_BOX (combo_vbox), label); + gtk_container_add (GTK_CONTAINER (combo_vbox), label); list_combo = create_combo ("list-combo", TRUE); gtk_widget_set_margin_start (list_combo, 12); - gtk_box_pack_start (GTK_BOX (combo_vbox), list_combo); + gtk_container_add (GTK_CONTAINER (combo_vbox), list_combo); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_hexpand (scrolled_window, TRUE); - gtk_box_pack_start (GTK_BOX (hbox), scrolled_window); + gtk_container_add (GTK_CONTAINER (hbox), scrolled_window); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -281,24 +281,24 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (scrolled_window), text_view); button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (hbox), button_vbox); + gtk_container_add (GTK_CONTAINER (hbox), button_vbox); gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 300); button = gtk_button_new_with_label ("Insert"); - gtk_box_pack_start (GTK_BOX (button_vbox), button); + gtk_container_add (GTK_CONTAINER (button_vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (on_insert), NULL); button = gtk_button_new_with_label ("Delete"); - gtk_box_pack_start (GTK_BOX (button_vbox), button); + gtk_container_add (GTK_CONTAINER (button_vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (on_delete), NULL); button = gtk_button_new_with_label ("Reorder"); - gtk_box_pack_start (GTK_BOX (button_vbox), button); + gtk_container_add (GTK_CONTAINER (button_vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (on_reorder), NULL); button = gtk_button_new_with_label ("Animate"); - gtk_box_pack_start (GTK_BOX (button_vbox), button); + gtk_container_add (GTK_CONTAINER (button_vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (on_animate), NULL); gtk_widget_show (dialog); diff --git a/tests/testellipsise.c b/tests/testellipsise.c index a0d7cc1d82..7abb58f229 100644 --- a/tests/testellipsise.c +++ b/tests/testellipsise.c @@ -131,9 +131,9 @@ main (int argc, char *argv[]) gtk_widget_set_vexpand (overlay, TRUE); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); - gtk_box_pack_start (GTK_BOX (vbox), combo); - gtk_box_pack_start (GTK_BOX (vbox), scale); - gtk_box_pack_start (GTK_BOX (vbox), overlay); + gtk_container_add (GTK_CONTAINER (vbox), combo); + gtk_container_add (GTK_CONTAINER (vbox), scale); + gtk_container_add (GTK_CONTAINER (vbox), overlay); g_object_set_data (G_OBJECT (label), "combo", combo); diff --git a/tests/testentrycompletion.c b/tests/testentrycompletion.c index 1ca802eaec..bc019d4841 100644 --- a/tests/testentrycompletion.c +++ b/tests/testentrycompletion.c @@ -307,7 +307,7 @@ main (int argc, char *argv[]) label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example."); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); /* Create our first entry */ entry = gtk_entry_new (); @@ -392,7 +392,7 @@ main (int argc, char *argv[]) g_timeout_add (1000, (GSourceFunc) animation_timer, completion); /* Fourth entry */ - gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Model-less entry completion")); + gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Model-less entry completion")); entry = gtk_entry_new (); diff --git a/tests/testexpand.c b/tests/testexpand.c index de820237ee..348e66dd85 100644 --- a/tests/testexpand.c +++ b/tests/testexpand.c @@ -53,24 +53,22 @@ create_box_window (void) box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); box3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (box1), + gtk_container_add (GTK_CONTAINER (box1), gtk_label_new ("VBox 1 Top")); - gtk_box_pack_start (GTK_BOX (box1), + gtk_container_add (GTK_CONTAINER (box1), box2); - gtk_box_pack_end (GTK_BOX (box1), - gtk_label_new ("VBox 1 Bottom")); + gtk_container_add (GTK_CONTAINER(box1), + gtk_label_new ("VBox 1 Bottom")); - gtk_box_pack_start (GTK_BOX (box2), + gtk_container_add (GTK_CONTAINER (box2), gtk_label_new ("HBox 2 Left")); - gtk_box_pack_start (GTK_BOX (box2), + gtk_container_add (GTK_CONTAINER (box2), box3); - gtk_box_pack_end (GTK_BOX (box2), - gtk_label_new ("HBox 2 Right")); + gtk_container_add (GTK_CONTAINER(box2), + gtk_label_new ("HBox 2 Right")); - gtk_box_pack_start (GTK_BOX (box3), + gtk_container_add (GTK_CONTAINER (box3), gtk_label_new ("VBox 3 Top")); - gtk_box_pack_end (GTK_BOX (box3), - gtk_label_new ("VBox 3 Bottom")); colorbox = gtk_frame_new (NULL); @@ -82,7 +80,7 @@ create_box_window (void) G_CALLBACK (on_toggle_hexpand), NULL); gtk_container_add (GTK_CONTAINER (colorbox), toggle); - gtk_box_pack_start (GTK_BOX (box3), colorbox); + gtk_container_add (GTK_CONTAINER (box3), colorbox); colorbox = gtk_frame_new (NULL); @@ -93,7 +91,9 @@ create_box_window (void) g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (on_toggle_vexpand), NULL); gtk_container_add (GTK_CONTAINER (colorbox), toggle); - gtk_box_pack_start (GTK_BOX (box3), colorbox); + gtk_container_add (GTK_CONTAINER (box3), colorbox); + gtk_container_add (GTK_CONTAINER (box3), + gtk_label_new ("VBox 3 Bottom")); gtk_container_add (GTK_CONTAINER (window), box1); gtk_widget_show (window); diff --git a/tests/testexpander.c b/tests/testexpander.c index 3b08dea5ff..114ef8bc94 100644 --- a/tests/testexpander.c +++ b/tests/testexpander.c @@ -9,8 +9,6 @@ expander_cb (GtkExpander *expander, GParamSpec *pspec, GtkWindow *dialog) static void do_not_expand (GtkWidget *child, gpointer data) { - gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (child)), child, - "expand", FALSE, "fill", FALSE, NULL); } static void @@ -24,7 +22,6 @@ main (int argc, char *argv[]) { GtkWidget *dialog; GtkWidget *area; - GtkWidget *box; GtkWidget *expander; GtkWidget *sw; GtkWidget *tv; @@ -43,10 +40,6 @@ main (int argc, char *argv[]) "but not the full story."); area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog)); - /* make the hbox expand */ - box = gtk_widget_get_parent (area); - gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (box)), box, - "expand", TRUE, "fill", TRUE, NULL); /* make the labels not expand */ gtk_container_foreach (GTK_CONTAINER (area), do_not_expand, NULL); @@ -74,7 +67,7 @@ main (int argc, char *argv[]) gtk_container_add (GTK_CONTAINER (expander), sw); gtk_widget_set_hexpand (expander, TRUE); gtk_widget_set_vexpand (expander, TRUE); - gtk_box_pack_end (GTK_BOX (area), expander); + gtk_container_add (GTK_CONTAINER (area), expander); g_signal_connect (expander, "notify::expanded", G_CALLBACK (expander_cb), dialog); diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index 2906a2428f..e18419994b 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -663,11 +663,11 @@ main (int argc, char **argv) gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (dialog), preview_vbox); preview_label = gtk_label_new (NULL); - gtk_box_pack_start (GTK_BOX (preview_vbox), preview_label, TRUE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (preview_vbox), preview_label, TRUE, TRUE, 0); g_object_set (preview_label, "margin", 6, NULL); preview_image = gtk_image_new (); - gtk_box_pack_start (GTK_BOX (preview_vbox), preview_image, TRUE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (preview_vbox), preview_image, TRUE, TRUE, 0); g_object_set (preview_image, "margin", 6, NULL); update_preview_cb (GTK_FILE_CHOOSER (dialog)); diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c index 4aa89dd7bb..e4b03d5e01 100644 --- a/tests/testfilechooserbutton.c +++ b/tests/testfilechooserbutton.c @@ -124,25 +124,25 @@ tests_button_clicked_cb (GtkButton *real_button, button = gtk_button_new_with_label ("Print Selected Path"); g_signal_connect (button, "clicked", G_CALLBACK (print_selected_path_clicked_cb), user_data); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); gtk_widget_show (button); button = gtk_button_new_with_label ("Add $PWD's Parent as Shortcut"); g_signal_connect (button, "clicked", G_CALLBACK (add_pwds_parent_as_shortcut_clicked_cb), user_data); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); gtk_widget_show (button); button = gtk_button_new_with_label ("Remove $PWD's Parent as Shortcut"); g_signal_connect (button, "clicked", G_CALLBACK (del_pwds_parent_as_shortcut_clicked_cb), user_data); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); gtk_widget_show (button); button = gtk_button_new_with_label ("Unselect all"); g_signal_connect (button, "clicked", G_CALLBACK (unselect_all_clicked_cb), user_data); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); gtk_widget_show (button); g_object_set_data (user_data, "tests-dialog", tests); @@ -216,12 +216,12 @@ add_new_filechooser_button (const gchar *mnemonic, GtkWidget *hbox, *label, *chooser, *button; hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); - gtk_box_pack_start (GTK_BOX (group_box), hbox); + gtk_container_add (GTK_CONTAINER (group_box), hbox); label = gtk_label_new_with_mnemonic (mnemonic); gtk_size_group_add_widget (GTK_SIZE_GROUP (label_group), label); gtk_label_set_xalign (GTK_LABEL (label), 0.0); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); chooser = gtk_file_chooser_button_new (g_strconcat(chooser_title, " - testfilechooserbutton", NULL), @@ -235,11 +235,11 @@ add_new_filechooser_button (const gchar *mnemonic, g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL); g_signal_connect (chooser, "file-activated", G_CALLBACK (chooser_file_activated_cb), NULL); g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL); - gtk_box_pack_start (GTK_BOX (hbox), chooser); + gtk_container_add (GTK_CONTAINER (hbox), chooser); button = gtk_button_new_with_label ("Tests"); g_signal_connect (button, "clicked", G_CALLBACK (tests_button_clicked_cb), chooser); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); } @@ -278,7 +278,7 @@ main (int argc, frame = gtk_frame_new ("<b>GtkFileChooserButton</b>"); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); gtk_label_set_use_markup (GTK_LABEL (gtk_frame_get_label_widget (GTK_FRAME (frame))), TRUE); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); gtk_widget_set_halign (frame, GTK_ALIGN_FILL); gtk_widget_set_valign (frame, GTK_ALIGN_FILL); diff --git a/tests/testflowbox.c b/tests/testflowbox.c index 5a94ab6fcd..980627a9ea 100644 --- a/tests/testflowbox.c +++ b/tests/testflowbox.c @@ -386,7 +386,7 @@ create_window (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); swindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_hexpand (swindow, TRUE); @@ -394,7 +394,7 @@ create_window (void) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_show (swindow); - gtk_box_pack_start (GTK_BOX (hbox), swindow); + gtk_container_add (GTK_CONTAINER (hbox), swindow); flowbox = gtk_flow_box_new (); gtk_widget_set_halign (flowbox, GTK_ALIGN_END); @@ -423,14 +423,14 @@ create_window (void) gtk_widget_show (flowbox_cntl); gtk_widget_show (expander); gtk_container_add (GTK_CONTAINER (expander), flowbox_cntl); - gtk_box_pack_start (GTK_BOX (vbox), expander); + gtk_container_add (GTK_CONTAINER (vbox), expander); widget = gtk_check_button_new_with_label ("Homogeneous"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set whether the items should be displayed at the same size"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (homogeneous_toggled), flowbox); @@ -441,7 +441,7 @@ create_window (void) flowbox, "activate-on-single-click", G_BINDING_SYNC_CREATE); gtk_widget_show (widget); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); /* Add alignment controls */ widget = gtk_combo_box_text_new (); @@ -453,7 +453,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the horizontal alignment policy"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (horizontal_alignment_changed), flowbox); @@ -467,7 +467,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the vertical alignment policy"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (vertical_alignment_changed), flowbox); @@ -480,7 +480,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the flowbox orientation"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (orientation_changed), flowbox); @@ -495,7 +495,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the selection mode"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (selection_mode_changed), flowbox); @@ -506,7 +506,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the minimum amount of items per line before wrapping"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (line_length_changed), flowbox); @@ -519,7 +519,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the natural amount of items per line "); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (max_line_length_changed), flowbox); @@ -531,41 +531,41 @@ create_window (void) gtk_widget_show (hbox); widget = gtk_label_new ("H Spacing"); - gtk_box_pack_start (GTK_BOX (hbox), widget); + gtk_container_add (GTK_CONTAINER (hbox), widget); widget = gtk_spin_button_new_with_range (0, 30, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_CSPACING); gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the horizontal spacing between children"); - gtk_box_pack_start (GTK_BOX (hbox), widget); + gtk_container_add (GTK_CONTAINER (hbox), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_HORIZONTAL)); g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_HORIZONTAL)); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), hbox); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), hbox); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_widget_show (hbox); widget = gtk_label_new ("V Spacing"); - gtk_box_pack_start (GTK_BOX (hbox), widget); + gtk_container_add (GTK_CONTAINER (hbox), widget); widget = gtk_spin_button_new_with_range (0, 30, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_RSPACING); gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the vertical spacing between children"); - gtk_box_pack_start (GTK_BOX (hbox), widget); + gtk_container_add (GTK_CONTAINER (hbox), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_VERTICAL)); g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_VERTICAL)); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), hbox); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), hbox); /* filtering and sorting */ @@ -574,7 +574,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set whether some items should be filtered out"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (filter_toggled), flowbox); @@ -584,7 +584,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set whether items should be sorted"); - gtk_box_pack_start (GTK_BOX (flowbox_cntl), widget); + gtk_container_add (GTK_CONTAINER (flowbox_cntl), widget); g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (sort_toggled), flowbox); @@ -597,7 +597,7 @@ create_window (void) gtk_widget_show (items_cntl); gtk_widget_show (expander); gtk_container_add (GTK_CONTAINER (expander), items_cntl); - gtk_box_pack_start (GTK_BOX (vbox), expander); + gtk_container_add (GTK_CONTAINER (vbox), expander); /* Add Items control */ widget = gtk_combo_box_text_new (); @@ -610,7 +610,7 @@ create_window (void) gtk_widget_show (widget); gtk_widget_set_tooltip_text (widget, "Set the item set to use"); - gtk_box_pack_start (GTK_BOX (items_cntl), widget); + gtk_container_add (GTK_CONTAINER (items_cntl), widget); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (items_changed), flowbox); diff --git a/tests/testframe.c b/tests/testframe.c index f05a85de40..20ca049ec2 100644 --- a/tests/testframe.c +++ b/tests/testframe.c @@ -146,7 +146,7 @@ int main (int argc, char **argv) frame = GTK_FRAME (gtk_frame_new ("Test GtkFrame")); gtk_widget_set_vexpand (GTK_WIDGET (frame), TRUE); - gtk_box_pack_start (vbox, GTK_WIDGET (frame)); + gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (frame)); widget = gtk_button_new_with_label ("Hello!"); gtk_container_add (GTK_CONTAINER (frame), widget); @@ -154,7 +154,7 @@ int main (int argc, char **argv) grid = GTK_GRID (gtk_grid_new ()); gtk_grid_set_row_spacing (grid, 12); gtk_grid_set_column_spacing (grid, 6); - gtk_box_pack_start (vbox, GTK_WIDGET (grid)); + gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (grid)); xalign = gtk_frame_get_label_align (frame); diff --git a/tests/testgiconpixbuf.c b/tests/testgiconpixbuf.c index 33930b3faa..8a32943457 100644 --- a/tests/testgiconpixbuf.c +++ b/tests/testgiconpixbuf.c @@ -41,32 +41,32 @@ main (int argc, gtk_container_add (GTK_CONTAINER (toplevel), hbox); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - gtk_box_pack_start (GTK_BOX (hbox), vbox); + gtk_container_add (GTK_CONTAINER (hbox), vbox); image = gtk_image_new_from_gicon (G_ICON (pixbuf)); gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE); - gtk_box_pack_start (GTK_BOX (vbox), image); + gtk_container_add (GTK_CONTAINER (vbox), image); label = gtk_label_new (NULL); str = g_strdup_printf ("Normal icon, hash %u", g_icon_hash (G_ICON (pixbuf))); gtk_label_set_label (GTK_LABEL (label), str); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); otherpix = gdk_pixbuf_new_from_file ("gnome-textfile.png", NULL); emblem = g_emblem_new (G_ICON (otherpix)); emblemed = g_emblemed_icon_new (G_ICON (pixbuf), emblem); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - gtk_box_pack_start (GTK_BOX (hbox), vbox); + gtk_container_add (GTK_CONTAINER (hbox), vbox); image2 = gtk_image_new_from_gicon (emblemed); gtk_image_set_icon_size (GTK_IMAGE (image2), GTK_ICON_SIZE_LARGE); - gtk_box_pack_start (GTK_BOX (vbox), image2); + gtk_container_add (GTK_CONTAINER (vbox), image2); label = gtk_label_new (NULL); str = g_strdup_printf ("Emblemed icon, hash %u", g_icon_hash (emblemed)); gtk_label_set_label (GTK_LABEL (label), str); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); gtk_widget_show (toplevel); diff --git a/tests/testgrid.c b/tests/testgrid.c index 171af6395d..3d946e1dde 100644 --- a/tests/testgrid.c +++ b/tests/testgrid.c @@ -148,21 +148,21 @@ box_comparison (void) box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add (GTK_CONTAINER (vbox), box); - gtk_box_pack_start (GTK_BOX (box), test_widget ("1", "white")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("1", "white")); label = gtk_label_new ("Some ellipsizing text"); gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); gtk_label_set_width_chars (GTK_LABEL (label), 10); - gtk_box_pack_start (GTK_BOX (box), label); + gtk_container_add (GTK_CONTAINER (box), label); - gtk_box_pack_start (GTK_BOX (box), test_widget ("2", "green")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("2", "green")); label = gtk_label_new ("Some text that may wrap if needed"); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_width_chars (GTK_LABEL (label), 10); - gtk_box_pack_start (GTK_BOX (box), label); + gtk_container_add (GTK_CONTAINER (box), label); - gtk_box_pack_start (GTK_BOX (box), test_widget ("3", "red")); + gtk_container_add (GTK_CONTAINER (box), test_widget ("3", "red")); grid = gtk_grid_new (); gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL); diff --git a/tests/testgtk.c b/tests/testgtk.c index c975459fc7..2c9ea74936 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -152,10 +152,10 @@ build_alpha_widgets (void) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "<i>Entry: </i>"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); entry = gtk_entry_new (); gtk_widget_set_hexpand (entry, TRUE); - gtk_box_pack_start (GTK_BOX (hbox), entry); + gtk_container_add (GTK_CONTAINER (hbox), entry); gtk_widget_set_hexpand (hbox, TRUE); gtk_grid_attach (GTK_GRID (grid), hbox, 0, 3, 2, 1); @@ -209,18 +209,18 @@ create_alpha_window (GtkWidget *widget) content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (content_area), vbox); + gtk_container_add (GTK_CONTAINER (content_area), vbox); label = gtk_label_new (NULL); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); label = gtk_label_new (NULL); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); display = gtk_widget_get_display (window); on_composited_changed (display, NULL, GTK_LABEL (label)); g_signal_connect (display, "notify::composited", G_CALLBACK (on_composited_changed), label); - gtk_box_pack_start (GTK_BOX (vbox), build_alpha_widgets ()); + gtk_container_add (GTK_CONTAINER (vbox), build_alpha_widgets ()); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), @@ -282,7 +282,7 @@ create_buttons (GtkWidget *widget) grid = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (grid), 5); gtk_grid_set_column_spacing (GTK_GRID (grid), 5); - gtk_box_pack_start (GTK_BOX (box1), grid); + gtk_container_add (GTK_CONTAINER (box1), grid); button[0] = gtk_button_new_with_label ("button1"); button[1] = gtk_button_new_with_mnemonic ("_button2"); @@ -307,16 +307,16 @@ create_buttons (GtkWidget *widget) } separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button[9] = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button[9], "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button[9]); + gtk_container_add (GTK_CONTAINER (box2), button[9]); gtk_widget_set_can_default (button[9], TRUE); gtk_widget_grab_default (button[9]); } @@ -356,28 +356,28 @@ create_toggle_buttons (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), box1); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_toggle_button_new_with_label ("button1"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_toggle_button_new_with_label ("button2"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_toggle_button_new_with_label ("button3"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); } @@ -476,26 +476,26 @@ create_check_buttons (GtkWidget *widget) box1 = gtk_dialog_get_content_area (GTK_DIALOG (window)); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_check_button_new_with_mnemonic ("_button1"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_check_button_new_with_label ("button2"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_check_button_new_with_label ("button3"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_check_button_new_with_label ("inconsistent"); gtk_check_button_set_inconsistent (GTK_CHECK_BUTTON (button), TRUE); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); table = create_widget_grid (GTK_TYPE_CHECK_BUTTON); - gtk_box_pack_start (GTK_BOX (box1), table); + gtk_container_add (GTK_CONTAINER (box1), table); } if (!gtk_widget_get_visible (window)) @@ -539,56 +539,56 @@ create_radio_buttons (GtkWidget *widget) box1 = gtk_dialog_get_content_area (GTK_DIALOG (window)); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_radio_button_new_with_label (NULL, "button1"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)), "button2"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)), "button3"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)), "inconsistent"); gtk_check_button_set_inconsistent (GTK_CHECK_BUTTON (button), TRUE); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_radio_button_new_with_label (NULL, "button4"); gtk_check_button_set_draw_indicator (GTK_CHECK_BUTTON (button), FALSE); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)), "button5"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_check_button_set_draw_indicator (GTK_CHECK_BUTTON (button), FALSE); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)), "button6"); gtk_check_button_set_draw_indicator (GTK_CHECK_BUTTON (button), FALSE); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); table = create_widget_grid (GTK_TYPE_RADIO_BUTTON); - gtk_box_pack_start (GTK_BOX (box1), table); + gtk_container_add (GTK_CONTAINER (box1), table); } if (!gtk_widget_get_visible (window)) @@ -663,47 +663,47 @@ create_button_box (GtkWidget *widget) frame_horz = gtk_frame_new ("Horizontal Button Boxes"); gtk_widget_set_margin_top (frame_horz, 10); gtk_widget_set_margin_bottom (frame_horz, 10); - gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz); + gtk_container_add (GTK_CONTAINER (main_vbox), frame_horz); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (frame_horz), vbox); - gtk_box_pack_start (GTK_BOX (vbox), + gtk_container_add (GTK_CONTAINER (vbox), create_bbox (TRUE, "Spread", 40, 85, 20, GTK_BUTTONBOX_SPREAD)); - gtk_box_pack_start (GTK_BOX (vbox), + gtk_container_add (GTK_CONTAINER (vbox), create_bbox (TRUE, "Edge", 40, 85, 20, GTK_BUTTONBOX_EDGE)); - gtk_box_pack_start (GTK_BOX (vbox), + gtk_container_add (GTK_CONTAINER (vbox), create_bbox (TRUE, "Start", 40, 85, 20, GTK_BUTTONBOX_START)); - gtk_box_pack_start (GTK_BOX (vbox), + gtk_container_add (GTK_CONTAINER (vbox), create_bbox (TRUE, "End", 40, 85, 20, GTK_BUTTONBOX_END)); - gtk_box_pack_start (GTK_BOX (vbox), + gtk_container_add (GTK_CONTAINER (vbox), create_bbox (TRUE, "Center", 40, 85, 20, GTK_BUTTONBOX_CENTER)); frame_vert = gtk_frame_new ("Vertical Button Boxes"); gtk_widget_set_margin_top (frame_vert, 10); gtk_widget_set_margin_bottom (frame_vert, 10); - gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert); + gtk_container_add (GTK_CONTAINER (main_vbox), frame_vert); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add (GTK_CONTAINER (frame_vert), hbox); - gtk_box_pack_start (GTK_BOX (hbox), + gtk_container_add (GTK_CONTAINER (hbox), create_bbox (FALSE, "Spread", 30, 85, 20, GTK_BUTTONBOX_SPREAD)); - gtk_box_pack_start (GTK_BOX (hbox), + gtk_container_add (GTK_CONTAINER (hbox), create_bbox (FALSE, "Edge", 30, 85, 20, GTK_BUTTONBOX_EDGE)); - gtk_box_pack_start (GTK_BOX (hbox), + gtk_container_add (GTK_CONTAINER (hbox), create_bbox (FALSE, "Start", 30, 85, 20, GTK_BUTTONBOX_START)); - gtk_box_pack_start (GTK_BOX (hbox), + gtk_container_add (GTK_CONTAINER (hbox), create_bbox (FALSE, "End", 30, 85, 20, GTK_BUTTONBOX_END)); - gtk_box_pack_start (GTK_BOX (hbox), + gtk_container_add (GTK_CONTAINER (hbox), create_bbox (FALSE, "Center", 30, 85, 20, GTK_BUTTONBOX_CENTER)); } @@ -847,10 +847,9 @@ create_statusbar (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), box1); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); statusbar = gtk_statusbar_new (); - gtk_box_pack_end (GTK_BOX (box1), statusbar); g_signal_connect (statusbar, "text_popped", G_CALLBACK (statusbar_popped), @@ -893,16 +892,17 @@ create_statusbar (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (box2), button); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), statusbar); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); } @@ -1063,45 +1063,45 @@ void create_labels (GtkWidget *widget) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_box_pack_end (GTK_BOX (vbox), hbox); button = create_sensitivity_control (hbox); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = create_selectable_control (hbox); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), hbox); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); - gtk_box_pack_start (GTK_BOX (hbox), vbox); + gtk_container_add (GTK_CONTAINER (hbox), vbox); frame = gtk_frame_new ("Normal Label"); label = gtk_label_new ("This is a Normal label"); gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_START); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Multi-line Label"); label = gtk_label_new ("This is a Multi-line label.\nSecond line\nThird line"); gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Left Justified Label"); label = gtk_label_new ("This is a Left-Justified\nMulti-line label.\nThird line"); gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Right Justified Label"); gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_START); label = gtk_label_new ("This is a Right-Justified\nMulti-line label.\nFourth line, (j/k)"); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Internationalized Label"); label = gtk_label_new (NULL); @@ -1114,13 +1114,13 @@ void create_labels (GtkWidget *widget) "Japanese <span lang=\"ja\">\345\205\203\346\260\227 \351\226\213\347\231\272</span>"); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Bidirection Label"); label = gtk_label_new ("\342\200\217Arabic \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205\n" "\342\200\217Hebrew \327\251\327\234\327\225\327\235"); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Links in a label"); label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\" title=\"plain text\">text</a> may be marked up\n" @@ -1128,11 +1128,11 @@ void create_labels (GtkWidget *widget) "or activated via <a href=\"keynav\">keynav</a>"); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); - gtk_box_pack_start (GTK_BOX (hbox), vbox); + gtk_container_add (GTK_CONTAINER (hbox), vbox); frame = gtk_frame_new ("Line wrapped label"); label = gtk_label_new ("This is an example of a line-wrapped label. It should not be taking "\ "up the entire "/* big space to test spacing */\ @@ -1144,7 +1144,7 @@ void create_labels (GtkWidget *widget) gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Filled, wrapped label"); label = gtk_label_new ("This is an example of a line-wrapped, filled label. It should be taking "\ @@ -1157,7 +1157,7 @@ void create_labels (GtkWidget *widget) gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Underlined label"); label = gtk_label_new ("This label is underlined!\n" @@ -1165,7 +1165,7 @@ void create_labels (GtkWidget *widget) gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_pattern (GTK_LABEL (label), "_________________________ _ _________ _ _____ _ __ __ ___ ____ _____"); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); frame = gtk_frame_new ("Markup label"); label = gtk_label_new (NULL); @@ -1192,7 +1192,7 @@ void create_labels (GtkWidget *widget) g_assert (gtk_label_get_mnemonic_keyval (GTK_LABEL (label)) == GDK_KEY_s); gtk_container_add (GTK_CONTAINER (frame), label); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); } if (!gtk_widget_get_visible (window)) @@ -1300,7 +1300,7 @@ create_rotated_text (GtkWidget *widget) content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); drawing_area = gtk_drawing_area_new (); - gtk_box_pack_start (GTK_BOX (content_area), drawing_area); + gtk_container_add (GTK_CONTAINER (content_area), drawing_area); tile_pixbuf = gdk_pixbuf_new_from_file ("marble.xpm", NULL); @@ -1359,10 +1359,10 @@ create_pixbuf (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), box1); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_button_new (); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gdk_surface = gtk_widget_get_surface (window); @@ -1375,7 +1375,7 @@ create_pixbuf (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (button), box3); button = gtk_button_new (); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); pixbufwid = new_pixbuf ("test.xpm", gdk_surface); @@ -1388,16 +1388,16 @@ create_pixbuf (GtkWidget *widget) gtk_widget_set_sensitive (button, FALSE); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); } @@ -1436,15 +1436,15 @@ create_tooltips (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), box1); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_toggle_button_new_with_label ("button1"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_tooltip_text (button, "This is button 1"); button = gtk_toggle_button_new_with_label ("button2"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_tooltip_text (button, "This is button 2. This is also a really long tooltip which probably " @@ -1452,7 +1452,7 @@ create_tooltips (GtkWidget *widget) "Hopefully the wrapping will work correctly."); toggle = gtk_toggle_button_new_with_label ("Override TipsQuery Label"); - gtk_box_pack_start (GTK_BOX (box2), toggle); + gtk_container_add (GTK_CONTAINER (box2), toggle); gtk_widget_set_tooltip_text (toggle, "Toggle TipsQuery view."); @@ -1480,16 +1480,16 @@ create_tooltips (GtkWidget *widget) gtk_box_set_child_packing (GTK_BOX (box2), frame, GTK_PACK_START); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); @@ -1511,10 +1511,10 @@ pack_image (GtkWidget *box, const gchar *text, GtkWidget *image) { - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), gtk_label_new (text)); - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), image); } @@ -2016,7 +2016,7 @@ create_menus (GtkWidget *widget) gtk_widget_show (box1); menubar = gtk_menu_bar_new (); - gtk_box_pack_start (GTK_BOX (box1), menubar); + gtk_container_add (GTK_CONTAINER (box1), menubar); gtk_widget_show (menubar); menu = create_menu (display, 2, 50); @@ -2053,7 +2053,7 @@ create_menus (GtkWidget *widget) gtk_widget_show (menuitem); menubar = gtk_menu_bar_new (); - gtk_box_pack_start (GTK_BOX (box1), menubar); + gtk_container_add (GTK_CONTAINER (box1), menubar); gtk_widget_show (menubar); menu = create_menu (display, 2, 10); @@ -2064,7 +2064,7 @@ create_menus (GtkWidget *widget) gtk_widget_show (menuitem); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); gtk_widget_show (box2); menu = create_menu (display, 1, 5); @@ -2106,22 +2106,22 @@ create_menus (GtkWidget *widget) optionmenu = gtk_combo_box_text_new (); gtk_combo_box_set_active (GTK_COMBO_BOX (optionmenu), 3); - gtk_box_pack_start (GTK_BOX (box2), optionmenu); + gtk_container_add (GTK_CONTAINER (box2), optionmenu); gtk_widget_show (optionmenu); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); gtk_widget_show (separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); gtk_widget_show (box2); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); gtk_widget_show (button); @@ -2188,33 +2188,33 @@ create_key_lookup (GtkWidget *widget) content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); button = gtk_button_new_with_mnemonic ("Button 1 (_a)"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = gtk_button_new_with_mnemonic ("Button 2 (_A)"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = gtk_button_new_with_mnemonic ("Button 3 (_\321\204)"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = gtk_button_new_with_mnemonic ("Button 4 (_\320\244)"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = gtk_button_new_with_mnemonic ("Button 6 (_b)"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = accel_button_new (accel_group, "Button 7", "<Alt><Shift>b"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = accel_button_new (accel_group, "Button 8", "<Alt>d"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = accel_button_new (accel_group, "Button 9", "<Alt>Cyrillic_ve"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = gtk_button_new_with_mnemonic ("Button 10 (_1)"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = gtk_button_new_with_mnemonic ("Button 11 (_!)"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = accel_button_new (accel_group, "Button 12", "<Super>a"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = accel_button_new (accel_group, "Button 13", "<Hyper>a"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = accel_button_new (accel_group, "Button 14", "<Meta>a"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); button = accel_button_new (accel_group, "Button 15", "<Shift><Mod4>b"); - gtk_box_pack_start (GTK_BOX (content_area), button); + gtk_container_add (GTK_CONTAINER (content_area), button); window_ptr = &window; g_object_add_weak_pointer (G_OBJECT (window), window_ptr); @@ -2314,12 +2314,12 @@ create_modal_window (GtkWidget *widget) /* Pack widgets */ gtk_container_add (GTK_CONTAINER (window), box1); - gtk_box_pack_start (GTK_BOX (box1), frame1); + gtk_container_add (GTK_CONTAINER (box1), frame1); gtk_container_add (GTK_CONTAINER (frame1), box2); - gtk_box_pack_start (GTK_BOX (box2), btnColor); - gtk_box_pack_start (GTK_BOX (box2), btnFile); - gtk_box_pack_start (GTK_BOX (box1), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); - gtk_box_pack_start (GTK_BOX (box1), btnClose); + gtk_container_add (GTK_CONTAINER (box2), btnColor); + gtk_container_add (GTK_CONTAINER (box2), btnFile); + gtk_container_add (GTK_CONTAINER (box1), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); + gtk_container_add (GTK_CONTAINER (box1), btnClose); /* connect signals */ g_signal_connect_swapped (btnClose, "clicked", @@ -2509,7 +2509,7 @@ create_scrolled_windows (GtkWidget *widget) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_box_pack_start (GTK_BOX (content_area), scrolled_window); + gtk_container_add (GTK_CONTAINER (content_area), scrolled_window); gtk_widget_show (scrolled_window); grid = gtk_grid_new (); @@ -2663,15 +2663,15 @@ create_entry (GtkWidget *widget) box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); - gtk_box_pack_start (GTK_BOX (box2), hbox); + gtk_container_add (GTK_CONTAINER (box2), hbox); entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), "hello world \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205"); gtk_editable_select_region (GTK_EDITABLE (entry), 0, 5); - gtk_box_pack_start (GTK_BOX (hbox), entry); + gtk_container_add (GTK_CONTAINER (hbox), entry); cb = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ()); @@ -2690,41 +2690,41 @@ create_entry (GtkWidget *widget) cb_entry = gtk_bin_get_child (GTK_BIN (cb)); gtk_entry_set_text (GTK_ENTRY (cb_entry), "hello world \n\n\n foo"); gtk_editable_select_region (GTK_EDITABLE (cb_entry), 0, -1); - gtk_box_pack_start (GTK_BOX (box2), GTK_WIDGET (cb)); + gtk_container_add (GTK_CONTAINER (box2), GTK_WIDGET (cb)); sensitive_check = gtk_check_button_new_with_label("Sensitive"); - gtk_box_pack_start (GTK_BOX (box2), sensitive_check); + gtk_container_add (GTK_CONTAINER (box2), sensitive_check); g_signal_connect (sensitive_check, "toggled", G_CALLBACK (entry_toggle_sensitive), entry); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sensitive_check), TRUE); has_frame_check = gtk_check_button_new_with_label("Has Frame"); - gtk_box_pack_start (GTK_BOX (box2), has_frame_check); + gtk_container_add (GTK_CONTAINER (box2), has_frame_check); g_signal_connect (has_frame_check, "toggled", G_CALLBACK (entry_toggle_frame), entry); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (has_frame_check), TRUE); progress_check = gtk_check_button_new_with_label("Show Progress"); - gtk_box_pack_start (GTK_BOX (box2), progress_check); + gtk_container_add (GTK_CONTAINER (box2), progress_check); g_signal_connect (progress_check, "toggled", G_CALLBACK (entry_toggle_progress), entry); progress_check = gtk_check_button_new_with_label("Pulse Progress"); - gtk_box_pack_start (GTK_BOX (box2), progress_check); + gtk_container_add (GTK_CONTAINER (box2), progress_check); g_signal_connect (progress_check, "toggled", G_CALLBACK (entry_toggle_pulse), entry); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); } @@ -2760,7 +2760,7 @@ create_expander (GtkWidget *widget) expander = gtk_expander_new ("The Hidden"); - gtk_box_pack_start (GTK_BOX (box1), expander); + gtk_container_add (GTK_CONTAINER (box1), expander); hidden = gtk_label_new ("Revealed!"); @@ -2831,7 +2831,7 @@ create_size_group_window (GdkDisplay *display, content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); grid = gtk_grid_new (); - gtk_box_pack_start (GTK_BOX (content_area), grid); + gtk_container_add (GTK_CONTAINER (content_area), grid); gtk_grid_set_row_spacing (GTK_GRID (grid), 5); gtk_grid_set_column_spacing (GTK_GRID (grid), 5); @@ -2892,17 +2892,17 @@ create_size_group_window (GdkDisplay *display, g_object_unref (vgroup2); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); - gtk_box_pack_start (GTK_BOX (content_area), hbox); + gtk_container_add (GTK_CONTAINER (content_area), hbox); spin_button = gtk_spin_button_new_with_range (1, 100, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), SIZE_GROUP_INITIAL_SIZE); - gtk_box_pack_start (GTK_BOX (hbox), spin_button); + gtk_container_add (GTK_CONTAINER (hbox), spin_button); g_signal_connect (spin_button, "value_changed", G_CALLBACK (size_group_hsize_changed), main_button); spin_button = gtk_spin_button_new_with_range (1, 100, 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), SIZE_GROUP_INITIAL_SIZE); - gtk_box_pack_start (GTK_BOX (hbox), spin_button); + gtk_container_add (GTK_CONTAINER (hbox), spin_button); g_signal_connect (spin_button, "value_changed", G_CALLBACK (size_group_vsize_changed), main_button); @@ -3154,7 +3154,7 @@ create_spins (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), main_vbox); frame = gtk_frame_new ("Not accelerated"); - gtk_box_pack_start (GTK_BOX (main_vbox), frame); + gtk_container_add (GTK_CONTAINER (main_vbox), frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (frame), vbox); @@ -3162,15 +3162,15 @@ create_spins (GtkWidget *widget) /* Time, month, hex spinners */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2); + gtk_container_add (GTK_CONTAINER (hbox), vbox2); label = gtk_label_new ("Time :"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox2), label); + gtk_container_add (GTK_CONTAINER (vbox2), label); adjustment = gtk_adjustment_new (0, 0, 1410, 30, 60, 0); spinner = gtk_spin_button_new (adjustment, 0, 0); @@ -3181,15 +3181,15 @@ create_spins (GtkWidget *widget) NULL); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 5); - gtk_box_pack_start (GTK_BOX (vbox2), spinner); + gtk_container_add (GTK_CONTAINER (vbox2), spinner); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2); + gtk_container_add (GTK_CONTAINER (hbox), vbox2); label = gtk_label_new ("Month :"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox2), label); + gtk_container_add (GTK_CONTAINER (vbox2), label); adjustment = gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0); @@ -3206,15 +3206,15 @@ create_spins (GtkWidget *widget) NULL); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 9); - gtk_box_pack_start (GTK_BOX (vbox2), spinner); + gtk_container_add (GTK_CONTAINER (vbox2), spinner); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2); + gtk_container_add (GTK_CONTAINER (hbox), vbox2); label = gtk_label_new ("Hex :"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox2), label); + gtk_container_add (GTK_CONTAINER (vbox2), label); adjustment = gtk_adjustment_new (0, 0, 255, 1, 16, 0); spinner = gtk_spin_button_new (adjustment, 0, 0); @@ -3229,87 +3229,87 @@ create_spins (GtkWidget *widget) NULL); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 4); - gtk_box_pack_start (GTK_BOX (vbox2), spinner); + gtk_container_add (GTK_CONTAINER (vbox2), spinner); frame = gtk_frame_new ("Accelerated"); - gtk_box_pack_start (GTK_BOX (main_vbox), frame); + gtk_container_add (GTK_CONTAINER (main_vbox), frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (frame), vbox); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2); + gtk_container_add (GTK_CONTAINER (hbox), vbox2); label = gtk_label_new ("Value :"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox2), label); + gtk_container_add (GTK_CONTAINER (vbox2), label); adjustment = gtk_adjustment_new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0); spinner1 = gtk_spin_button_new (adjustment, 1.0, 2); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE); - gtk_box_pack_start (GTK_BOX (vbox2), spinner1); + gtk_container_add (GTK_CONTAINER (vbox2), spinner1); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2); + gtk_container_add (GTK_CONTAINER (hbox), vbox2); label = gtk_label_new ("Digits :"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox2), label); + gtk_container_add (GTK_CONTAINER (vbox2), label); adjustment = gtk_adjustment_new (2, 1, 15, 1, 1, 0); spinner2 = gtk_spin_button_new (adjustment, 0.0, 0); g_signal_connect (adjustment, "value_changed", G_CALLBACK (change_digits), spinner2); - gtk_box_pack_start (GTK_BOX (vbox2), spinner2); + gtk_container_add (GTK_CONTAINER (vbox2), spinner2); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); button = gtk_check_button_new_with_label ("Snap to 0.5-ticks"); g_signal_connect (button, "clicked", G_CALLBACK (toggle_snap), spinner1); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); button = gtk_check_button_new_with_label ("Numeric only input mode"); g_signal_connect (button, "clicked", G_CALLBACK (toggle_numeric), spinner1); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); val_label = gtk_label_new (""); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); button = gtk_button_new_with_label ("Value as Int"); g_object_set_data (G_OBJECT (button), "user_data", val_label); g_signal_connect (button, "clicked", G_CALLBACK (get_value), GINT_TO_POINTER (1)); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); button = gtk_button_new_with_label ("Value as Float"); g_object_set_data (G_OBJECT (button), "user_data", val_label); g_signal_connect (button, "clicked", G_CALLBACK (get_value), GINT_TO_POINTER (2)); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); - gtk_box_pack_start (GTK_BOX (vbox), val_label); + gtk_container_add (GTK_CONTAINER (vbox), val_label); gtk_label_set_text (GTK_LABEL (val_label), "0"); frame = gtk_frame_new ("Using Convenience Constructor"); - gtk_box_pack_start (GTK_BOX (main_vbox), frame); + gtk_container_add (GTK_CONTAINER (main_vbox), frame); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add (GTK_CONTAINER (frame), hbox); @@ -3320,17 +3320,17 @@ create_spins (GtkWidget *widget) gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinner), 0.0); g_signal_connect (spinner, "value_changed", G_CALLBACK (get_spin_value), val_label); - gtk_box_pack_start (GTK_BOX (hbox), spinner); - gtk_box_pack_start (GTK_BOX (hbox), val_label); + gtk_container_add (GTK_CONTAINER (hbox), spinner); + gtk_container_add (GTK_CONTAINER (hbox), val_label); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (main_vbox), hbox); + gtk_container_add (GTK_CONTAINER (main_vbox), hbox); button = gtk_button_new_with_label ("Close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); } if (!gtk_widget_get_visible (window)) @@ -3614,20 +3614,20 @@ create_cursors (GtkWidget *widget) if (cursor_demo) { hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); label = gtk_label_new ("Cursor Theme:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), "default"); - gtk_box_pack_start (GTK_BOX (hbox), entry); + gtk_container_add (GTK_CONTAINER (hbox), entry); size = gtk_spin_button_new_with_range (1.0, 128.0, 1.0); gtk_spin_button_set_value (GTK_SPIN_BUTTON (size), 24.0); - gtk_box_pack_start (GTK_BOX (hbox), size); + gtk_container_add (GTK_CONTAINER (hbox), size); g_signal_connect (entry, "changed", G_CALLBACK (change_cursor_theme), hbox); @@ -3636,12 +3636,12 @@ create_cursors (GtkWidget *widget) } hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); label = gtk_label_new ("Cursor Name:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); entry = gtk_entry_new (); completion = gtk_entry_completion_new (); @@ -3650,7 +3650,7 @@ create_cursors (GtkWidget *widget) gtk_entry_completion_set_text_column (completion, 0); gtk_entry_set_completion (GTK_ENTRY (entry), completion); g_object_unref (model); - gtk_box_pack_start (GTK_BOX (hbox), entry); + gtk_container_add (GTK_CONTAINER (hbox), entry); frame = g_object_new (gtk_frame_get_type (), @@ -3675,16 +3675,16 @@ create_cursors (GtkWidget *widget) any = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (main_vbox), any); + gtk_container_add (GTK_CONTAINER (main_vbox), any); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (main_vbox), hbox); + gtk_container_add (GTK_CONTAINER (main_vbox), hbox); button = gtk_button_new_with_label ("Close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); gtk_widget_show (window); @@ -3838,7 +3838,7 @@ create_flipping (GtkWidget *widget) gtk_window_set_title (GTK_WINDOW (window), "Bidirectional Flipping"); check_button = gtk_check_button_new_with_label ("Right-to-left global direction"); - gtk_box_pack_start (GTK_BOX (content_area), check_button); + gtk_container_add (GTK_CONTAINER (content_area), check_button); if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); @@ -3847,18 +3847,18 @@ create_flipping (GtkWidget *widget) G_CALLBACK (flipping_toggled_cb), NULL); check_button = gtk_check_button_new_with_label ("Toggle orientation of all boxes"); - gtk_box_pack_start (GTK_BOX (content_area), check_button); + gtk_container_add (GTK_CONTAINER (content_area), check_button); g_signal_connect (check_button, "toggled", G_CALLBACK (flipping_orientation_toggled_cb), NULL); - gtk_box_pack_start (GTK_BOX (content_area), + gtk_container_add (GTK_CONTAINER (content_area), create_forward_back ("Default", GTK_TEXT_DIR_NONE)); - gtk_box_pack_start (GTK_BOX (content_area), + gtk_container_add (GTK_CONTAINER (content_area), create_forward_back ("Left-to-Right", GTK_TEXT_DIR_LTR)); - gtk_box_pack_start (GTK_BOX (content_area), + gtk_container_add (GTK_CONTAINER (content_area), create_forward_back ("Right-to-Left", GTK_TEXT_DIR_RTL)); gtk_dialog_add_button (GTK_DIALOG (window), "Close", GTK_RESPONSE_CLOSE); @@ -3946,7 +3946,7 @@ dialog_response_cb (GtkWidget *widget, gint response, gpointer unused) label = gtk_label_new ("Dialog Test"); g_object_set (label, "margin", 10, NULL); - gtk_box_pack_start (GTK_BOX (content_area), + gtk_container_add (GTK_CONTAINER (content_area), label); gtk_widget_show (label); } @@ -4169,7 +4169,7 @@ create_range_controls (GtkWidget *widget) box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); gtk_widget_show (box2); @@ -4179,11 +4179,11 @@ create_range_controls (GtkWidget *widget) gtk_widget_set_size_request (GTK_WIDGET (scale), 150, -1); gtk_scale_set_digits (GTK_SCALE (scale), 1); gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); - gtk_box_pack_start (GTK_BOX (box2), scale); + gtk_container_add (GTK_CONTAINER (box2), scale); gtk_widget_show (scale); scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (adjustment)); - gtk_box_pack_start (GTK_BOX (box2), scrollbar); + gtk_container_add (GTK_CONTAINER (box2), scrollbar); gtk_widget_show (scrollbar); scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (adjustment)); @@ -4192,7 +4192,7 @@ create_range_controls (GtkWidget *widget) "format_value", G_CALLBACK (reformat_value), NULL); - gtk_box_pack_start (GTK_BOX (box2), scale); + gtk_container_add (GTK_CONTAINER (box2), scale); gtk_widget_show (scale); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); @@ -4201,7 +4201,7 @@ create_range_controls (GtkWidget *widget) gtk_widget_set_size_request (scale, -1, 200); gtk_scale_set_digits (GTK_SCALE (scale), 2); gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); - gtk_box_pack_start (GTK_BOX (hbox), scale); + gtk_container_add (GTK_CONTAINER (hbox), scale); gtk_widget_show (scale); scale = gtk_scale_new (GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT (adjustment)); @@ -4209,7 +4209,7 @@ create_range_controls (GtkWidget *widget) gtk_scale_set_digits (GTK_SCALE (scale), 2); gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); gtk_range_set_inverted (GTK_RANGE (scale), TRUE); - gtk_box_pack_start (GTK_BOX (hbox), scale); + gtk_container_add (GTK_CONTAINER (hbox), scale); gtk_widget_show (scale); scale = gtk_scale_new (GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT (adjustment)); @@ -4218,20 +4218,20 @@ create_range_controls (GtkWidget *widget) "format_value", G_CALLBACK (reformat_value), NULL); - gtk_box_pack_start (GTK_BOX (hbox), scale); + gtk_container_add (GTK_CONTAINER (hbox), scale); gtk_widget_show (scale); - gtk_box_pack_start (GTK_BOX (box2), hbox); + gtk_container_add (GTK_CONTAINER (box2), hbox); gtk_widget_show (hbox); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); gtk_widget_show (separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); gtk_widget_show (box2); @@ -4239,7 +4239,7 @@ create_range_controls (GtkWidget *widget) g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); gtk_widget_show (button); @@ -4381,21 +4381,21 @@ create_pages (GtkNotebook *notebook, gint start, gint end) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_check_button_new_with_label ("Fill Tab"); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); g_signal_connect (button, "toggled", G_CALLBACK (tab_fill), child); button = gtk_check_button_new_with_label ("Expand Tab"); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); g_signal_connect (button, "toggled", G_CALLBACK (tab_expand), child); button = gtk_button_new_with_label ("Hide Page"); - gtk_box_pack_end (GTK_BOX (vbox), button); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_hide), child); @@ -4406,13 +4406,13 @@ create_pages (GtkNotebook *notebook, gint start, gint end) pixwid = gtk_image_new_from_pixbuf (book_closed); g_object_set_data (G_OBJECT (child), "tab_pixmap", pixwid); - gtk_box_pack_start (GTK_BOX (label_box), pixwid); + gtk_container_add (GTK_CONTAINER (label_box), pixwid); gtk_widget_set_margin_start (pixwid, 3); gtk_widget_set_margin_end (pixwid, 3); gtk_widget_set_margin_bottom (pixwid, 1); gtk_widget_set_margin_top (pixwid, 1); label = gtk_label_new_with_mnemonic (accel_buffer); - gtk_box_pack_start (GTK_BOX (label_box), label); + gtk_container_add (GTK_CONTAINER (label_box), label); gtk_widget_show (label_box); @@ -4420,13 +4420,13 @@ create_pages (GtkNotebook *notebook, gint start, gint end) pixwid = gtk_image_new_from_pixbuf (book_closed); g_object_set_data (G_OBJECT (child), "menu_pixmap", pixwid); - gtk_box_pack_start (GTK_BOX (menu_box), pixwid); + gtk_container_add (GTK_CONTAINER (menu_box), pixwid); gtk_widget_set_margin_start (pixwid, 3); gtk_widget_set_margin_end (pixwid, 3); gtk_widget_set_margin_bottom (pixwid, 1); gtk_widget_set_margin_top (pixwid, 1); label = gtk_label_new (buffer); - gtk_box_pack_start (GTK_BOX (menu_box), label); + gtk_container_add (GTK_CONTAINER (menu_box), label); gtk_widget_show (menu_box); gtk_notebook_append_page_menu (notebook, child, label_box, menu_box); @@ -4552,7 +4552,7 @@ create_notebook (GtkWidget *widget) g_signal_connect (sample_notebook, "switch_page", G_CALLBACK (page_switch), NULL); gtk_notebook_set_tab_pos (GTK_NOTEBOOK (sample_notebook), GTK_POS_TOP); - gtk_box_pack_start (GTK_BOX (box1), sample_notebook); + gtk_container_add (GTK_CONTAINER (box1), sample_notebook); gtk_widget_realize (sample_notebook); @@ -4565,62 +4565,62 @@ create_notebook (GtkWidget *widget) create_pages (GTK_NOTEBOOK (sample_notebook), 1, 5); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_check_button_new_with_label ("popup menu"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); g_signal_connect (button, "clicked", G_CALLBACK (notebook_popup), sample_notebook); box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); label = gtk_label_new ("Notebook Style :"); - gtk_box_pack_start (GTK_BOX (box2), label); + gtk_container_add (GTK_CONTAINER (box2), label); omenu = build_option_menu (items, G_N_ELEMENTS (items), 0, notebook_type_changed, sample_notebook); - gtk_box_pack_start (GTK_BOX (box2), omenu); + gtk_container_add (GTK_CONTAINER (box2), omenu); button = gtk_button_new_with_label ("Show all Pages"); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); g_signal_connect (button, "clicked", G_CALLBACK (show_all_pages), sample_notebook); box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_box_set_homogeneous (GTK_BOX (box2), TRUE); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_button_new_with_label ("prev"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_notebook_prev_page), sample_notebook); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_button_new_with_label ("next"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_notebook_next_page), sample_notebook); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); button = gtk_button_new_with_label ("rotate"); g_signal_connect (button, "clicked", G_CALLBACK (rotate_notebook), sample_notebook); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box1), button); + gtk_container_add (GTK_CONTAINER (box1), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); } @@ -4743,7 +4743,7 @@ create_panes (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), vbox); vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_box_pack_start (GTK_BOX (vbox), vpaned); + gtk_container_add (GTK_CONTAINER (vbox), vpaned); hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_paned_add1 (GTK_PANED (vpaned), hpaned); @@ -4768,13 +4768,13 @@ create_panes (GtkWidget *widget) /* Now create toggle buttons to control sizing */ - gtk_box_pack_start (GTK_BOX (vbox), + gtk_container_add (GTK_CONTAINER (vbox), create_pane_options (GTK_PANED (hpaned), "Horizontal", "Left", "Right")); - gtk_box_pack_start (GTK_BOX (vbox), + gtk_container_add (GTK_CONTAINER (vbox), create_pane_options (GTK_PANED (vpaned), "Vertical", "Top", @@ -4833,13 +4833,13 @@ paned_keyboard_window1 (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (frame1), vbox1); button7 = gtk_button_new_with_label ("button7"); - gtk_box_pack_start (GTK_BOX (vbox1), button7); + gtk_container_add (GTK_CONTAINER (vbox1), button7); button8 = gtk_button_new_with_label ("button8"); - gtk_box_pack_start (GTK_BOX (vbox1), button8); + gtk_container_add (GTK_CONTAINER (vbox1), button8); button9 = gtk_button_new_with_label ("button9"); - gtk_box_pack_start (GTK_BOX (vbox1), button9); + gtk_container_add (GTK_CONTAINER (vbox1), button9); vpaned1 = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_paned_pack2 (GTK_PANED (hpaned1), vpaned1, TRUE, TRUE); @@ -4855,10 +4855,10 @@ paned_keyboard_window1 (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (frame5), hbox1); button5 = gtk_button_new_with_label ("button5"); - gtk_box_pack_start (GTK_BOX (hbox1), button5); + gtk_container_add (GTK_CONTAINER (hbox1), button5); button6 = gtk_button_new_with_label ("button6"); - gtk_box_pack_start (GTK_BOX (hbox1), button6); + gtk_container_add (GTK_CONTAINER (hbox1), button6); frame3 = gtk_frame_new (NULL); gtk_paned_pack2 (GTK_PANED (vpaned1), frame3, TRUE, TRUE); @@ -4920,7 +4920,7 @@ paned_keyboard_window2 (GtkWidget *widget) gtk_paned_pack2 (GTK_PANED (hpaned2), hbox2, TRUE, TRUE); vpaned2 = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_box_pack_start (GTK_BOX (hbox2), vpaned2); + gtk_container_add (GTK_CONTAINER (hbox2), vpaned2); frame7 = gtk_frame_new (NULL); gtk_paned_pack1 (GTK_PANED (vpaned2), frame7, FALSE, TRUE); @@ -4937,7 +4937,7 @@ paned_keyboard_window2 (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (frame8), button11); button10 = gtk_button_new_with_label ("button10"); - gtk_box_pack_start (GTK_BOX (hbox2), button10); + gtk_container_add (GTK_CONTAINER (hbox2), button10); return window2; } @@ -4972,10 +4972,10 @@ paned_keyboard_window3 (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window3), vbox2); label1 = gtk_label_new ("Three panes nested inside each other"); - gtk_box_pack_start (GTK_BOX (vbox2), label1); + gtk_container_add (GTK_CONTAINER (vbox2), label1); hpaned3 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (vbox2), hpaned3); + gtk_container_add (GTK_CONTAINER (vbox2), hpaned3); frame9 = gtk_frame_new (NULL); gtk_paned_pack1 (GTK_PANED (hpaned3), frame9, FALSE, TRUE); @@ -5046,11 +5046,11 @@ paned_keyboard_window4 (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window4), vbox3); label2 = gtk_label_new ("Widget tree:\n\nhpaned \n - vpaned\n - hbox\n - vpaned\n - vpaned\n - vpaned\n"); - gtk_box_pack_start (GTK_BOX (vbox3), label2); + gtk_container_add (GTK_CONTAINER (vbox3), label2); gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT); hpaned6 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (vbox3), hpaned6); + gtk_container_add (GTK_CONTAINER (vbox3), hpaned6); vpaned3 = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_paned_pack1 (GTK_PANED (hpaned6), vpaned3, FALSE, TRUE); @@ -5065,7 +5065,7 @@ paned_keyboard_window4 (GtkWidget *widget) gtk_paned_pack2 (GTK_PANED (hpaned6), hbox3, TRUE, TRUE); vpaned4 = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_box_pack_start (GTK_BOX (hbox3), vpaned4); + gtk_container_add (GTK_CONTAINER (hbox3), vpaned4); button21 = gtk_button_new_with_label ("button21"); gtk_paned_pack1 (GTK_PANED (vpaned4), button21, FALSE, TRUE); @@ -5074,7 +5074,7 @@ paned_keyboard_window4 (GtkWidget *widget) gtk_paned_pack2 (GTK_PANED (vpaned4), button20, TRUE, TRUE); vpaned5 = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_box_pack_start (GTK_BOX (hbox3), vpaned5); + gtk_container_add (GTK_CONTAINER (hbox3), vpaned5); button23 = gtk_button_new_with_label ("button23"); gtk_paned_pack1 (GTK_PANED (vpaned5), button23, FALSE, TRUE); @@ -5083,7 +5083,7 @@ paned_keyboard_window4 (GtkWidget *widget) gtk_paned_pack2 (GTK_PANED (vpaned5), button22, TRUE, TRUE); vpaned6 = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_box_pack_start (GTK_BOX (hbox3), vpaned6); + gtk_container_add (GTK_CONTAINER (hbox3), vpaned6); button25 = gtk_button_new_with_label ("button25"); gtk_paned_pack1 (GTK_PANED (vpaned6), button25, FALSE, TRUE); @@ -5221,17 +5221,17 @@ create_wmhints (GtkWidget *widget) label = gtk_label_new ("Try iconizing me!"); gtk_widget_set_size_request (label, 150, 50); - gtk_box_pack_start (GTK_BOX (box1), label); + gtk_container_add (GTK_CONTAINER (box1), label); gtk_widget_show (label); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); gtk_widget_show (separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); gtk_widget_show (box2); @@ -5241,7 +5241,7 @@ create_wmhints (GtkWidget *widget) G_CALLBACK (gtk_widget_destroy), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); gtk_widget_show (button); @@ -5305,7 +5305,7 @@ tracking_label (GtkWidget *window) label = gtk_label_new ("<no window state events received>"); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); g_object_set_data (G_OBJECT (label), "title", (gpointer)gtk_window_get_title (GTK_WINDOW (window))); g_signal_connect (gtk_widget_get_surface (window), "notify::state", @@ -5318,7 +5318,7 @@ tracking_label (GtkWidget *window) G_CALLBACK (gtk_window_deiconify), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); button = gtk_button_new_with_label ("Iconify"); g_signal_connect_object (button, @@ -5326,7 +5326,7 @@ tracking_label (GtkWidget *window) G_CALLBACK (gtk_window_iconify), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); button = gtk_button_new_with_label ("Fullscreen"); g_signal_connect_object (button, @@ -5334,7 +5334,7 @@ tracking_label (GtkWidget *window) G_CALLBACK (gtk_window_fullscreen), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); button = gtk_button_new_with_label ("Unfullscreen"); g_signal_connect_object (button, @@ -5342,7 +5342,7 @@ tracking_label (GtkWidget *window) G_CALLBACK (gtk_window_unfullscreen), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); button = gtk_button_new_with_label ("Present"); g_signal_connect_object (button, @@ -5350,7 +5350,7 @@ tracking_label (GtkWidget *window) G_CALLBACK (gtk_window_present), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); button = gtk_button_new_with_label ("Show"); g_signal_connect_object (button, @@ -5358,7 +5358,7 @@ tracking_label (GtkWidget *window) G_CALLBACK (gtk_widget_show), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); gtk_widget_show (hbox); @@ -5406,7 +5406,7 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_window_stick), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Unstick"); g_signal_connect_object (button, @@ -5414,7 +5414,7 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_window_unstick), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Maximize"); g_signal_connect_object (button, @@ -5422,7 +5422,7 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_window_maximize), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Unmaximize"); g_signal_connect_object (button, @@ -5430,7 +5430,7 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_window_unmaximize), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Iconify"); g_signal_connect_object (button, @@ -5438,7 +5438,7 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_window_iconify), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Fullscreen"); g_signal_connect_object (button, @@ -5446,7 +5446,7 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_window_fullscreen), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Unfullscreen"); g_signal_connect_object (button, @@ -5454,21 +5454,21 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_window_unfullscreen), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button_above = gtk_toggle_button_new_with_label ("Keep above"); g_signal_connect (button_above, "toggled", G_CALLBACK (keep_window_above), window); - gtk_box_pack_start (GTK_BOX (vbox), button_above); + gtk_container_add (GTK_CONTAINER (vbox), button_above); button_below = gtk_toggle_button_new_with_label ("Keep below"); g_signal_connect (button_below, "toggled", G_CALLBACK (keep_window_below), window); - gtk_box_pack_start (GTK_BOX (vbox), button_below); + gtk_container_add (GTK_CONTAINER (vbox), button_below); g_object_set_data (G_OBJECT (button_above), "radio", button_below); g_object_set_data (G_OBJECT (button_below), "radio", button_above); @@ -5479,7 +5479,7 @@ get_state_controls (GtkWidget *window) G_CALLBACK (gtk_widget_hide), window, G_CONNECT_SWAPPED); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); gtk_widget_show (vbox); @@ -5735,21 +5735,21 @@ window_controls (GtkWidget *window) gtk_container_add (GTK_CONTAINER (control_window), vbox); label = gtk_label_new ("<no size>"); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); g_signal_connect_after (window, "size-allocate", G_CALLBACK (size_allocate_callback), label); adjustment = gtk_adjustment_new (10.0, -2000.0, 2000.0, 1.0, 5.0, 0.0); spin = gtk_spin_button_new (adjustment, 0, 0); - gtk_box_pack_start (GTK_BOX (vbox), spin); + gtk_container_add (GTK_CONTAINER (vbox), spin); g_object_set_data (G_OBJECT (control_window), "spin1", spin); adjustment = gtk_adjustment_new (10.0, -2000.0, 2000.0, 1.0, 5.0, 0.0); spin = gtk_spin_button_new (adjustment, 0, 0); - gtk_box_pack_start (GTK_BOX (vbox), spin); + gtk_container_add (GTK_CONTAINER (vbox), spin); g_object_set_data (G_OBJECT (control_window), "spin2", spin); @@ -5759,56 +5759,56 @@ window_controls (GtkWidget *window) G_CALLBACK (gtk_widget_queue_resize), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Resize"); g_signal_connect (button, "clicked", G_CALLBACK (set_size_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Set default size"); g_signal_connect (button, "clicked", G_CALLBACK (set_default_size_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Unset default size"); g_signal_connect (button, "clicked", G_CALLBACK (unset_default_size_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Set size request"); g_signal_connect (button, "clicked", G_CALLBACK (set_size_request_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Unset size request"); g_signal_connect (button, "clicked", G_CALLBACK (unset_size_request_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Move"); g_signal_connect (button, "clicked", G_CALLBACK (set_location_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label ("Move to current position"); g_signal_connect (button, "clicked", G_CALLBACK (move_to_position_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_check_button_new_with_label ("Allow resize"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); @@ -5816,7 +5816,7 @@ window_controls (GtkWidget *window) "toggled", G_CALLBACK (resizable_callback), control_window); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_mnemonic ("_Show"); g_signal_connect_object (button, @@ -5824,7 +5824,7 @@ window_controls (GtkWidget *window) G_CALLBACK (gtk_widget_show), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_mnemonic ("_Hide"); g_signal_connect_object (button, @@ -5832,23 +5832,21 @@ window_controls (GtkWidget *window) G_CALLBACK (gtk_widget_hide), window, G_CONNECT_SWAPPED); - gtk_box_pack_end (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); + + + om = gtk_combo_box_text_new (); i = 0; - while (i < 10) + while (i < 5) { static gchar *names[] = { - "GDK_GRAVITY_NORTH_WEST", - "GDK_GRAVITY_NORTH", - "GDK_GRAVITY_NORTH_EAST", - "GDK_GRAVITY_WEST", - "GDK_GRAVITY_CENTER", - "GDK_GRAVITY_EAST", - "GDK_GRAVITY_SOUTH_WEST", - "GDK_GRAVITY_SOUTH", - "GDK_GRAVITY_SOUTH_EAST", - "GDK_GRAVITY_STATIC", + "GTK_WIN_POS_NONE", + "GTK_WIN_POS_CENTER", + "GTK_WIN_POS_MOUSE", + "GTK_WIN_POS_CENTER_ALWAYS", + "GTK_WIN_POS_CENTER_ON_PARENT", NULL }; @@ -5860,22 +5858,26 @@ window_controls (GtkWidget *window) g_signal_connect (om, "changed", - G_CALLBACK (gravity_selected), + G_CALLBACK (pos_selected), control_window); - gtk_box_pack_end (GTK_BOX (vbox), om); - + gtk_container_add (GTK_CONTAINER (vbox), om); om = gtk_combo_box_text_new (); i = 0; - while (i < 5) + while (i < 10) { static gchar *names[] = { - "GTK_WIN_POS_NONE", - "GTK_WIN_POS_CENTER", - "GTK_WIN_POS_MOUSE", - "GTK_WIN_POS_CENTER_ALWAYS", - "GTK_WIN_POS_CENTER_ON_PARENT", + "GDK_GRAVITY_NORTH_WEST", + "GDK_GRAVITY_NORTH", + "GDK_GRAVITY_NORTH_EAST", + "GDK_GRAVITY_WEST", + "GDK_GRAVITY_CENTER", + "GDK_GRAVITY_EAST", + "GDK_GRAVITY_SOUTH_WEST", + "GDK_GRAVITY_SOUTH", + "GDK_GRAVITY_SOUTH_EAST", + "GDK_GRAVITY_STATIC", NULL }; @@ -5887,10 +5889,10 @@ window_controls (GtkWidget *window) g_signal_connect (om, "changed", - G_CALLBACK (pos_selected), + G_CALLBACK (gravity_selected), control_window); - gtk_box_pack_end (GTK_BOX (vbox), om); + gtk_container_add (GTK_CONTAINER (vbox), om); gtk_widget_show (vbox); @@ -6128,10 +6130,10 @@ create_progress_bar (GtkWidget *widget) gtk_window_set_title (GTK_WINDOW (pdata->window), "GtkProgressBar"); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); - gtk_box_pack_start (GTK_BOX (content_area), vbox); + gtk_container_add (GTK_CONTAINER (content_area), vbox); frame = gtk_frame_new ("Progress"); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (frame), vbox2); @@ -6141,19 +6143,19 @@ create_progress_bar (GtkWidget *widget) PANGO_ELLIPSIZE_MIDDLE); gtk_widget_set_halign (pdata->pbar, GTK_ALIGN_CENTER); gtk_widget_set_valign (pdata->pbar, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox2), pdata->pbar); + gtk_container_add (GTK_CONTAINER (vbox2), pdata->pbar); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER); gtk_widget_set_valign (hbox, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (vbox2), hbox); + gtk_container_add (GTK_CONTAINER (vbox2), hbox); label = gtk_label_new ("Label updated by user :"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); pdata->label = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), pdata->label); + gtk_container_add (GTK_CONTAINER (hbox), pdata->label); frame = gtk_frame_new ("Options"); - gtk_box_pack_start (GTK_BOX (vbox), frame); + gtk_container_add (GTK_CONTAINER (vbox), frame); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (frame), vbox2); @@ -6161,7 +6163,7 @@ create_progress_bar (GtkWidget *widget) grid = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (grid), 10); gtk_grid_set_column_spacing (GTK_GRID (grid), 10); - gtk_box_pack_start (GTK_BOX (vbox2), grid); + gtk_container_add (GTK_CONTAINER (vbox2), grid); label = gtk_label_new ("Orientation :"); gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1); @@ -6190,14 +6192,14 @@ create_progress_bar (GtkWidget *widget) gtk_grid_attach (GTK_GRID (grid), hbox, 1, 2, 1, 1); label = gtk_label_new ("Text: "); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); pdata->entry = gtk_entry_new (); gtk_widget_set_hexpand (pdata->entry, TRUE); g_signal_connect (pdata->entry, "changed", G_CALLBACK (entry_changed), pdata); - gtk_box_pack_start (GTK_BOX (hbox), pdata->entry); + gtk_container_add (GTK_CONTAINER (hbox), pdata->entry); gtk_widget_set_size_request (pdata->entry, 100, -1); label = gtk_label_new ("Ellipsize text :"); @@ -6303,7 +6305,7 @@ create_timeout_test (GtkWidget *widget) label = gtk_label_new ("count: 0"); g_object_set (label, "margin", 10, NULL); - gtk_box_pack_start (GTK_BOX (content_area), label); + gtk_container_add (GTK_CONTAINER (content_area), label); gtk_widget_show (label); button = gtk_button_new_with_label ("close"); @@ -6311,7 +6313,7 @@ create_timeout_test (GtkWidget *widget) G_CALLBACK (gtk_widget_destroy), window); gtk_widget_set_can_default (button, TRUE); - gtk_box_pack_start (GTK_BOX (action_area), button); + gtk_container_add (GTK_CONTAINER (action_area), button); gtk_widget_grab_default (button); gtk_widget_show (button); @@ -6320,7 +6322,7 @@ create_timeout_test (GtkWidget *widget) G_CALLBACK(start_timeout_test), label); gtk_widget_set_can_default (button, TRUE); - gtk_box_pack_start (GTK_BOX (action_area), button); + gtk_container_add (GTK_CONTAINER (action_area), button); gtk_widget_show (button); button = gtk_button_new_with_label ("stop"); @@ -6328,7 +6330,7 @@ create_timeout_test (GtkWidget *widget) G_CALLBACK (stop_timeout_test), NULL); gtk_widget_set_can_default (button, TRUE); - gtk_box_pack_start (GTK_BOX (action_area), button); + gtk_container_add (GTK_CONTAINER (action_area), button); gtk_widget_show (button); } @@ -6374,7 +6376,7 @@ create_mainloop (GtkWidget *widget) label = gtk_label_new ("In recursive main loop..."); g_object_set (label, "margin", 20, NULL); - gtk_box_pack_start (GTK_BOX (content_area), label); + gtk_container_add (GTK_CONTAINER (content_area), label); gtk_widget_show (label); gtk_dialog_add_button (GTK_DIALOG (window), @@ -6778,7 +6780,7 @@ create_native_dialogs (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), box); label = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (box), label); + gtk_container_add (GTK_CONTAINER (box), label); combo = gtk_combo_box_text_new (); @@ -6791,7 +6793,7 @@ create_native_dialogs (GtkWidget *widget) g_signal_connect (combo, "changed", G_CALLBACK (native_action_changed), native); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_box_pack_start (GTK_BOX (box), combo); + gtk_container_add (GTK_CONTAINER (box), combo); combo = gtk_combo_box_text_new (); @@ -6802,34 +6804,34 @@ create_native_dialogs (GtkWidget *widget) g_signal_connect (combo, "changed", G_CALLBACK (native_filter_changed), native); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); - gtk_box_pack_start (GTK_BOX (box), combo); + gtk_container_add (GTK_CONTAINER (box), combo); check_button = gtk_check_button_new_with_label ("Modal"); g_signal_connect (check_button, "toggled", G_CALLBACK (native_modal_toggle), native); - gtk_box_pack_start (GTK_BOX (box), check_button); + gtk_container_add (GTK_CONTAINER (box), check_button); check_button = gtk_check_button_new_with_label ("Multiple select"); g_signal_connect (check_button, "toggled", G_CALLBACK (native_multi_select_toggle), native); - gtk_box_pack_start (GTK_BOX (box), check_button); + gtk_container_add (GTK_CONTAINER (box), check_button); check_button = gtk_check_button_new_with_label ("Confirm overwrite"); g_signal_connect (check_button, "toggled", G_CALLBACK (native_overwrite_confirmation_toggle), native); - gtk_box_pack_start (GTK_BOX (box), check_button); + gtk_container_add (GTK_CONTAINER (box), check_button); check_button = gtk_check_button_new_with_label ("Extra widget"); g_signal_connect (check_button, "toggled", G_CALLBACK (native_extra_widget_toggle), native); - gtk_box_pack_start (GTK_BOX (box), check_button); + gtk_container_add (GTK_CONTAINER (box), check_button); show_button = gtk_button_new_with_label ("Show"); hide_button = gtk_button_new_with_label ("Hide"); gtk_widget_set_sensitive (hide_button, FALSE); - gtk_box_pack_start (GTK_BOX (box), show_button); - gtk_box_pack_start (GTK_BOX (box), hide_button); + gtk_container_add (GTK_CONTAINER (box), show_button); + gtk_container_add (GTK_CONTAINER (box), hide_button); /* connect signals */ g_signal_connect (native, "response", @@ -6951,7 +6953,7 @@ create_main_window (void) gtk_get_minor_version ()); label = gtk_label_new (buffer); - gtk_box_pack_start (GTK_BOX (box1), label); + gtk_container_add (GTK_CONTAINER (box1), label); gtk_widget_set_name (label, "testgtk-version-label"); scrolled_window = gtk_scrolled_window_new (NULL, NULL); @@ -6959,7 +6961,7 @@ create_main_window (void) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_box_pack_start (GTK_BOX (box1), scrolled_window); + gtk_container_add (GTK_CONTAINER (box1), scrolled_window); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (scrolled_window), box2); @@ -6975,20 +6977,20 @@ create_main_window (void) NULL); else gtk_widget_set_sensitive (button, FALSE); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); } separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_box_pack_start (GTK_BOX (box1), separator); + gtk_container_add (GTK_CONTAINER (box1), separator); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_box_pack_start (GTK_BOX (box1), box2); + gtk_container_add (GTK_CONTAINER (box1), box2); button = gtk_button_new_with_mnemonic ("_Close"); g_signal_connect (button, "clicked", G_CALLBACK (do_exit), window); - gtk_box_pack_start (GTK_BOX (box2), button); + gtk_container_add (GTK_CONTAINER (box2), button); gtk_widget_set_can_default (button, TRUE); gtk_widget_grab_default (button); diff --git a/tests/testheaderbar.c b/tests/testheaderbar.c index 3a8121d251..51f5a97a13 100644 --- a/tests/testheaderbar.c +++ b/tests/testheaderbar.c @@ -85,11 +85,11 @@ change_header (GtkButton *button, gpointer data) gtk_style_context_add_class (gtk_widget_get_style_context (header), "header-bar"); g_object_set (header, "margin", 10, NULL); label = gtk_label_new ("Label"); - gtk_box_pack_start (GTK_BOX (header), label); + gtk_container_add (GTK_CONTAINER (header), label); widget = gtk_level_bar_new (); gtk_level_bar_set_value (GTK_LEVEL_BAR (widget), 0.4); gtk_widget_set_hexpand (widget, TRUE); - gtk_box_pack_start (GTK_BOX (header), widget); + gtk_container_add (GTK_CONTAINER (header), widget); } else { @@ -142,6 +142,12 @@ main (int argc, char *argv[]) box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), box); + + content = gtk_image_new_from_icon_name ("start-here-symbolic"); + gtk_image_set_pixel_size (GTK_IMAGE (content), 512); + + gtk_container_add (GTK_CONTAINER (box), content); + footer = gtk_action_bar_new (); gtk_action_bar_set_center_widget (GTK_ACTION_BAR (footer), gtk_check_button_new_with_label ("Middle")); button = gtk_toggle_button_new_with_label ("Custom"); @@ -153,13 +159,7 @@ main (int argc, char *argv[]) button = gtk_button_new_with_label ("Fullscreen"); gtk_action_bar_pack_end (GTK_ACTION_BAR (footer), button); g_signal_connect (button, "clicked", G_CALLBACK (toggle_fullscreen), window); - gtk_box_pack_end (GTK_BOX (box), footer); - - content = gtk_image_new_from_icon_name ("start-here-symbolic"); - gtk_image_set_pixel_size (GTK_IMAGE (content), 512); - - gtk_box_pack_start (GTK_BOX (box), content); - + gtk_container_add (GTK_CONTAINER (box), footer); gtk_widget_show (window); gtk_main (); diff --git a/tests/testheightforwidth.c b/tests/testheightforwidth.c index 40937b6720..3a09bede1e 100644 --- a/tests/testheightforwidth.c +++ b/tests/testheightforwidth.c @@ -824,7 +824,7 @@ create_window (void) g_signal_connect (button, "clicked", G_CALLBACK (test_clicked), &interfaces[i]); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); } return window; diff --git a/tests/testiconview.c b/tests/testiconview.c index 8ecf6b204f..576133ad33 100644 --- a/tests/testiconview.c +++ b/tests/testiconview.c @@ -425,7 +425,7 @@ main (gint argc, gchar **argv) paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_set_vexpand (paned, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), paned); + gtk_container_add (GTK_CONTAINER (vbox), paned); icon_list = gtk_icon_view_new (); gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_list), GTK_SELECTION_MULTIPLE); @@ -541,43 +541,43 @@ main (gint argc, gchar **argv) bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_START); - gtk_box_pack_start (GTK_BOX (vbox), bbox); + gtk_container_add (GTK_CONTAINER (vbox), bbox); button = gtk_button_new_with_label ("Add some"); g_signal_connect (button, "clicked", G_CALLBACK (add_some), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Add many"); g_signal_connect (button, "clicked", G_CALLBACK (add_many), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Add large"); g_signal_connect (button, "clicked", G_CALLBACK (add_large), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Remove selected"); g_signal_connect (button, "clicked", G_CALLBACK (foreach_selected_remove), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Swap"); g_signal_connect (button, "clicked", G_CALLBACK (swap_rows), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_START); - gtk_box_pack_start (GTK_BOX (vbox), bbox); + gtk_container_add (GTK_CONTAINER (vbox), bbox); button = gtk_button_new_with_label ("Select all"); g_signal_connect (button, "clicked", G_CALLBACK (select_all), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Unselect all"); g_signal_connect (button, "clicked", G_CALLBACK (unselect_all), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label ("Select nonexisting"); g_signal_connect (button, "clicked", G_CALLBACK (select_nonexisting), icon_list); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); icon_list = gtk_icon_view_new (); diff --git a/tests/testorientable.c b/tests/testorientable.c index 6ac6988ca8..f997c9209a 100644 --- a/tests/testorientable.c +++ b/tests/testorientable.c @@ -62,22 +62,22 @@ main (int argc, char **argv) box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); orientables = g_list_prepend (orientables, box); gtk_grid_attach (GTK_GRID (grid), box, 0, 1, 1, 1); - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), gtk_button_new_with_label ("GtkBox 1")); - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), gtk_button_new_with_label ("GtkBox 2")); - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), gtk_button_new_with_label ("GtkBox 3")); /* GtkButtonBox */ box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); orientables = g_list_prepend (orientables, box); gtk_grid_attach (GTK_GRID (grid), box, 1, 1, 1, 1); - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), gtk_button_new_with_label ("GtkButtonBox 1")); - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), gtk_button_new_with_label ("GtkButtonBox 2")); - gtk_box_pack_start (GTK_BOX (box), + gtk_container_add (GTK_CONTAINER (box), gtk_button_new_with_label ("GtkButtonBox 3")); /* GtkSeparator */ diff --git a/tests/testoverlay.c b/tests/testoverlay.c index 6e5634f7ef..60b8f68b2e 100644 --- a/tests/testoverlay.c +++ b/tests/testoverlay.c @@ -468,12 +468,12 @@ test_input_stacking (void) "But the entry does"); gtk_widget_set_margin_top (label, 8); gtk_widget_set_margin_bottom (label, 8); - gtk_box_pack_start (GTK_BOX (vbox), label); + gtk_container_add (GTK_CONTAINER (vbox), label); entry = gtk_entry_new (); gtk_widget_set_margin_top (entry, 8); gtk_widget_set_margin_bottom (entry, 8); - gtk_box_pack_start (GTK_BOX (vbox), entry); + gtk_container_add (GTK_CONTAINER (vbox), entry); gtk_container_add (GTK_CONTAINER (win), overlay); diff --git a/tests/testpixbuf-scale.c b/tests/testpixbuf-scale.c index aae1a841ed..5e48ef8bd1 100644 --- a/tests/testpixbuf-scale.c +++ b/tests/testpixbuf-scale.c @@ -108,13 +108,13 @@ main(int argc, char **argv) NULL); gtk_widget_set_halign (combo_box, GTK_ALIGN_START); - gtk_box_pack_start (GTK_BOX (vbox), combo_box); + gtk_container_add (GTK_CONTAINER (vbox), combo_box); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); label = gtk_label_new ("Overall Alpha:"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); adjustment = gtk_adjustment_new (overall_alpha, 0, 255, 1, 10, 0); g_signal_connect (adjustment, "value_changed", @@ -123,7 +123,7 @@ main(int argc, char **argv) hscale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment); gtk_scale_set_digits (GTK_SCALE (hscale), 0); gtk_widget_set_hexpand (hscale, TRUE); - gtk_box_pack_start (GTK_BOX (hbox), hscale); + gtk_container_add (GTK_CONTAINER (hbox), hscale); /* Compute the size without the drawing area, so we know how big to make the default size */ gtk_widget_get_preferred_size ( (vbox), @@ -131,7 +131,7 @@ main(int argc, char **argv) darea = gtk_drawing_area_new (); gtk_widget_set_hexpand (darea, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), darea); + gtk_container_add (GTK_CONTAINER (vbox), darea); gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (darea), draw_func, NULL, NULL); diff --git a/tests/testscale.c b/tests/testscale.c index 61b585709b..484bb9c97c 100644 --- a/tests/testscale.c +++ b/tests/testscale.c @@ -130,7 +130,7 @@ int main (int argc, char *argv[]) scales = g_slist_prepend (scales, scale); gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); frame = gtk_frame_new ("With fill level"); scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1); @@ -139,7 +139,7 @@ int main (int argc, char *argv[]) gtk_range_set_show_fill_level (GTK_RANGE (scale), TRUE); gtk_range_set_fill_level (GTK_RANGE (scale), 50); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); frame = gtk_frame_new ("Simple marks"); extra_scale = scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1); @@ -149,7 +149,7 @@ int main (int argc, char *argv[]) gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_BOTTOM, NULL); gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_BOTTOM, NULL); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); frame = gtk_frame_new ("Simple marks up"); scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1); @@ -159,7 +159,7 @@ int main (int argc, char *argv[]) gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_TOP, NULL); gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_TOP, NULL); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); frame = gtk_frame_new ("Labeled marks"); box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); @@ -171,7 +171,7 @@ int main (int argc, char *argv[]) gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_BOTTOM, labels[1]); gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_BOTTOM, labels[2]); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); frame = gtk_frame_new ("Some labels"); scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1); @@ -181,7 +181,7 @@ int main (int argc, char *argv[]) gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_TOP, NULL); gtk_scale_add_mark (GTK_SCALE (scale), marks[2], GTK_POS_TOP, labels[2]); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); frame = gtk_frame_new ("Above and below"); scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1); @@ -192,7 +192,7 @@ int main (int argc, char *argv[]) gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[2], GTK_POS_BOTTOM, bath_labels[2]); gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[3], GTK_POS_TOP, bath_labels[3]); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); frame = gtk_frame_new ("Positions"); scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1); @@ -203,7 +203,7 @@ int main (int argc, char *argv[]) gtk_scale_add_mark (GTK_SCALE (scale), pos_marks[2], GTK_POS_TOP, pos_labels[2]); gtk_scale_add_mark (GTK_SCALE (scale), pos_marks[3], GTK_POS_BOTTOM, pos_labels[3]); gtk_container_add (GTK_CONTAINER (frame), scale); - gtk_box_pack_start (GTK_BOX (box), frame); + gtk_container_add (GTK_CONTAINER (box), frame); box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_container_add (GTK_CONTAINER (box1), box2); 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); diff --git a/tests/testsensitive.c b/tests/testsensitive.c index 18306cec44..4085b51373 100644 --- a/tests/testsensitive.c +++ b/tests/testsensitive.c @@ -65,15 +65,15 @@ int main (int argc, char *argv[]) gtk_container_add (GTK_CONTAINER (window), box); w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 15); - gtk_box_pack_start (GTK_BOX (box), w); - gtk_box_pack_start (GTK_BOX (w), gtk_entry_new ()); + gtk_container_add (GTK_CONTAINER (box), w); + gtk_container_add (GTK_CONTAINER (w), gtk_entry_new ()); bu = gtk_button_new_with_label ("Bu"); - gtk_box_pack_start (GTK_BOX (w), bu); + gtk_container_add (GTK_CONTAINER (w), bu); c = gtk_switch_new (); gtk_switch_set_active (GTK_SWITCH (c), TRUE); gtk_widget_set_halign (c, GTK_ALIGN_CENTER); gtk_widget_set_valign (c, GTK_ALIGN_CENTER); - gtk_box_pack_start (GTK_BOX (box), c); + gtk_container_add (GTK_CONTAINER (box), c); g_signal_connect (bu, "clicked", G_CALLBACK (set_insensitive), w); g_signal_connect (bu, "state-flags-changed", G_CALLBACK (state_flags_changed), NULL); diff --git a/tests/testspinbutton.c b/tests/testspinbutton.c index e16ad3bbf3..49420a69a5 100644 --- a/tests/testspinbutton.c +++ b/tests/testspinbutton.c @@ -60,7 +60,7 @@ prepare_window_for_orientation (GtkOrientation orientation) g_object_bind_property (wrap_button, "active", spin, "wrap", G_BINDING_SYNC_CREATE); GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); - gtk_box_pack_start (GTK_BOX (hbox), spin); + gtk_container_add (GTK_CONTAINER (hbox), spin); gtk_container_add (GTK_CONTAINER (mainbox), hbox); } diff --git a/tests/teststack.c b/tests/teststack.c index e5d61eb142..cc75460def 100644 --- a/tests/teststack.c +++ b/tests/teststack.c @@ -127,7 +127,7 @@ main (gint argc, gtk_container_add (GTK_CONTAINER (window), box); switcher = gtk_stack_switcher_new (); - gtk_box_pack_start (GTK_BOX (box), switcher); + gtk_container_add (GTK_CONTAINER (box), switcher); stack = gtk_stack_new (); @@ -141,9 +141,9 @@ main (gint argc, sidebar = gtk_stack_sidebar_new (); gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack)); layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (layout), sidebar); + gtk_container_add (GTK_CONTAINER (layout), sidebar); gtk_widget_set_hexpand (stack, TRUE); - gtk_box_pack_start (GTK_BOX (layout), stack); + gtk_container_add (GTK_CONTAINER (layout), stack); gtk_container_add (GTK_CONTAINER (box), layout); 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; diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c index c49b2cdb5f..57c7ceb1b3 100644 --- a/tests/testtoolbar.c +++ b/tests/testtoolbar.c @@ -457,19 +457,19 @@ main (gint argc, gchar **argv) gtk_grid_attach (GTK_GRID (grid), hbox2, 1, 2, 1, 1); checkbox = gtk_check_button_new_with_mnemonic("_Vertical"); - gtk_box_pack_start (GTK_BOX (hbox1), checkbox); + gtk_container_add (GTK_CONTAINER (hbox1), checkbox); g_signal_connect (checkbox, "toggled", G_CALLBACK (change_orientation), toolbar); checkbox = gtk_check_button_new_with_mnemonic("_Show Arrow"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE); - gtk_box_pack_start (GTK_BOX (hbox1), checkbox); + gtk_container_add (GTK_CONTAINER (hbox1), checkbox); g_signal_connect (checkbox, "toggled", G_CALLBACK (change_show_arrow), toolbar); checkbox = gtk_check_button_new_with_mnemonic("_Set Toolbar Style:"); g_signal_connect (checkbox, "toggled", G_CALLBACK (set_toolbar_style_toggled), toolbar); - gtk_box_pack_start (GTK_BOX (hbox1), checkbox); + gtk_container_add (GTK_CONTAINER (hbox1), checkbox); option_menu = gtk_combo_box_text_new (); gtk_widget_set_sensitive (option_menu, FALSE); @@ -479,7 +479,7 @@ main (gint argc, gchar **argv) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (option_menu), toolbar_styles[i]); gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), gtk_toolbar_get_style (GTK_TOOLBAR (toolbar))); - gtk_box_pack_start (GTK_BOX (hbox2), option_menu); + gtk_container_add (GTK_CONTAINER (hbox2), option_menu); g_signal_connect (option_menu, "changed", G_CALLBACK (change_toolbar_style), toolbar); @@ -630,13 +630,16 @@ main (gint argc, gchar **argv) gtk_grid_attach (GTK_GRID (grid), hbox, 1, 4, 1, 1); button = gtk_button_new_with_label ("Drag me to the toolbar"); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); label = gtk_label_new ("Drop index:"); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_container_add (GTK_CONTAINER (hbox), label); label = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), label); + gtk_widget_set_hexpand (label, TRUE); + gtk_widget_set_halign (label, GTK_ALIGN_START); + gtk_container_add (GTK_CONTAINER (hbox), label); + checkbox = gtk_check_button_new_with_mnemonic("_Right to left"); if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) @@ -645,7 +648,7 @@ main (gint argc, gchar **argv) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), FALSE); g_signal_connect (checkbox, "toggled", G_CALLBACK (rtl_toggled), NULL); - gtk_box_pack_end (GTK_BOX (hbox), checkbox); + gtk_container_add (GTK_CONTAINER (hbox), checkbox); targets = gdk_content_formats_new (target_table, G_N_ELEMENTS (target_table)); gtk_drag_source_set (button, GDK_BUTTON1_MASK, diff --git a/tests/testtooltips.c b/tests/testtooltips.c index f464a3142b..04eda125e1 100644 --- a/tests/testtooltips.c +++ b/tests/testtooltips.c @@ -313,7 +313,7 @@ main (int argc, char *argv[]) /* A check button using the tooltip-markup property */ button = gtk_check_button_new_with_label ("This one uses the tooltip-markup property"); gtk_widget_set_tooltip_text (button, "Hello, I am a static tooltip."); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); text = gtk_widget_get_tooltip_text (button); markup = gtk_widget_get_tooltip_markup (button); @@ -326,13 +326,13 @@ main (int argc, char *argv[]) g_object_set (button, "has-tooltip", TRUE, NULL); g_signal_connect (button, "query-tooltip", G_CALLBACK (query_tooltip_cb), NULL); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); /* A label */ button = gtk_label_new ("I am just a label"); gtk_label_set_selectable (GTK_LABEL (button), FALSE); gtk_widget_set_tooltip_text (button, "Label & and tooltip"); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); text = gtk_widget_get_tooltip_text (button); markup = gtk_widget_get_tooltip_markup (button); @@ -344,7 +344,7 @@ main (int argc, char *argv[]) button = gtk_label_new ("I am a selectable label"); gtk_label_set_selectable (GTK_LABEL (button), TRUE); gtk_widget_set_tooltip_markup (button, "<b>Another</b> Label tooltip"); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); text = gtk_widget_get_tooltip_text (button); markup = gtk_widget_get_tooltip_markup (button); @@ -354,7 +354,7 @@ main (int argc, char *argv[]) /* Another one, with a custom tooltip window */ button = gtk_check_button_new_with_label ("This one has a custom tooltip window!"); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); tooltip_window = gtk_window_new (GTK_WINDOW_POPUP); tooltip_button = gtk_label_new ("blaat!"); @@ -375,7 +375,7 @@ main (int argc, char *argv[]) button = gtk_button_new_with_label ("This one is insensitive"); gtk_widget_set_sensitive (button, FALSE); g_object_set (button, "tooltip-text", "Insensitive!", NULL); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); /* Testcases from Kris without a tree view don't exist. */ tree_view = gtk_tree_view_new_with_model (create_model ()); @@ -398,7 +398,7 @@ main (int argc, char *argv[]) gtk_tree_view_column_set_clickable (column, TRUE); g_object_set (gtk_tree_view_column_get_button (column), "tooltip-text", "Header", NULL); - gtk_box_pack_start (GTK_BOX (box), tree_view); + gtk_container_add (GTK_CONTAINER (box), tree_view); /* And a text view for Matthias */ buffer = gtk_text_buffer_new (NULL); @@ -422,7 +422,7 @@ main (int argc, char *argv[]) g_signal_connect (text_view, "query-tooltip", G_CALLBACK (query_tooltip_text_view_cb), tag); - gtk_box_pack_start (GTK_BOX (box), text_view); + gtk_container_add (GTK_CONTAINER (box), text_view); /* Drawing area */ drawing_area = gtk_drawing_area_new (); @@ -433,7 +433,7 @@ main (int argc, char *argv[]) g_object_set (drawing_area, "has-tooltip", TRUE, NULL); g_signal_connect (drawing_area, "query-tooltip", G_CALLBACK (query_tooltip_drawing_area_cb), NULL); - gtk_box_pack_start (GTK_BOX (box), drawing_area); + gtk_container_add (GTK_CONTAINER (box), drawing_area); button = gtk_label_new ("Custom tooltip I"); label = gtk_label_new ("See, custom"); @@ -441,13 +441,13 @@ main (int argc, char *argv[]) g_object_set (button, "has-tooltip", TRUE, NULL); g_signal_connect (button, "query-tooltip", G_CALLBACK (query_tooltip_label_cb), label); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); button = gtk_label_new ("Custom tooltip II"); label = gtk_label_new ("See, custom, too"); g_object_ref_sink (label); g_object_set (button, "has-tooltip", TRUE, NULL); - gtk_box_pack_start (GTK_BOX (box), button); + gtk_container_add (GTK_CONTAINER (box), button); g_signal_connect (button, "query-tooltip", G_CALLBACK (query_tooltip_label_cb), label); diff --git a/tests/testtreecolumns.c b/tests/testtreecolumns.c index 148752be26..ad58c97833 100644 --- a/tests/testtreecolumns.c +++ b/tests/testtreecolumns.c @@ -769,7 +769,7 @@ main (int argc, char *argv[]) gtk_container_add (GTK_CONTAINER (window), vbox); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); /* Left Pane */ cell = gtk_cell_renderer_text_new (); @@ -786,52 +786,52 @@ main (int argc, char *argv[]) gtk_tree_view_append_column (GTK_TREE_VIEW (left_tree_view), column); gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL); - gtk_box_pack_start (GTK_BOX (hbox), swindow); + gtk_container_add (GTK_CONTAINER (hbox), swindow); /* Middle Pane */ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (hbox), vbox2); + gtk_container_add (GTK_CONTAINER (hbox), vbox2); bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD); - gtk_box_pack_start (GTK_BOX (vbox2), bbox); + gtk_container_add (GTK_CONTAINER (vbox2), bbox); button = gtk_button_new_with_mnemonic ("<< (_Q)"); gtk_widget_set_sensitive (button, FALSE); g_signal_connect (button, "clicked", G_CALLBACK (add_left_clicked), top_right_tree_view); g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (top_right_tree_view)), "changed", G_CALLBACK (selection_changed), button); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_mnemonic (">> (_W)"); gtk_widget_set_sensitive (button, FALSE); g_signal_connect (button, "clicked", G_CALLBACK (add_right_clicked), top_right_tree_view); g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view)), "changed", G_CALLBACK (selection_changed), button); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD); - gtk_box_pack_start (GTK_BOX (vbox2), bbox); + gtk_container_add (GTK_CONTAINER (vbox2), bbox); button = gtk_button_new_with_mnemonic ("<< (_E)"); gtk_widget_set_sensitive (button, FALSE); g_signal_connect (button, "clicked", G_CALLBACK (add_left_clicked), bottom_right_tree_view); g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (bottom_right_tree_view)), "changed", G_CALLBACK (selection_changed), button); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_mnemonic (">> (_R)"); gtk_widget_set_sensitive (button, FALSE); g_signal_connect (button, "clicked", G_CALLBACK (add_right_clicked), bottom_right_tree_view); g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view)), "changed", G_CALLBACK (selection_changed), button); - gtk_box_pack_start (GTK_BOX (bbox), button); + gtk_container_add (GTK_CONTAINER (bbox), button); /* Right Pane */ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (hbox), vbox2); + gtk_container_add (GTK_CONTAINER (hbox), vbox2); swindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -846,7 +846,7 @@ main (int argc, char *argv[]) gtk_tree_view_append_column (GTK_TREE_VIEW (top_right_tree_view), column); gtk_container_add (GTK_CONTAINER (swindow), top_right_tree_view); - gtk_box_pack_start (GTK_BOX (vbox2), swindow); + gtk_container_add (GTK_CONTAINER (vbox2), swindow); swindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -860,7 +860,7 @@ main (int argc, char *argv[]) gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (bottom_right_tree_view), column); gtk_container_add (GTK_CONTAINER (swindow), bottom_right_tree_view); - gtk_box_pack_start (GTK_BOX (vbox2), swindow); + gtk_container_add (GTK_CONTAINER (vbox2), swindow); /* Drag and Drop */ @@ -890,13 +890,13 @@ main (int argc, char *argv[]) GDK_ACTION_MOVE); gdk_content_formats_unref (targets); - gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); + gtk_container_add (GTK_CONTAINER (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); button = gtk_button_new_with_mnemonic ("_Add new Column"); g_signal_connect (button, "clicked", G_CALLBACK (add_clicked), left_tree_model); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); gtk_widget_show (window); gtk_main (); diff --git a/tests/testtreecolumnsizing.c b/tests/testtreecolumnsizing.c index 3f247771d3..7bd3187b58 100644 --- a/tests/testtreecolumnsizing.c +++ b/tests/testtreecolumnsizing.c @@ -190,7 +190,7 @@ main (int argc, char **argv) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), BORDER_EXPAND); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), ALL_EXPAND); - gtk_box_pack_start (GTK_BOX (vbox), combo_box); + gtk_container_add (GTK_CONTAINER (vbox), combo_box); /* Scrolled window and tree view */ sw = gtk_scrolled_window_new (NULL, NULL); @@ -198,7 +198,7 @@ main (int argc, char **argv) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (sw, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), sw); + gtk_container_add (GTK_CONTAINER (vbox), sw); tree_view = gtk_tree_view_new_with_model (create_model ()); gtk_container_add (GTK_CONTAINER (sw), tree_view); @@ -221,7 +221,7 @@ main (int argc, char **argv) button = gtk_toggle_button_new_with_label ("Toggle long content row"); g_signal_connect (button, "toggled", G_CALLBACK (toggle_long_content_row), tree_view); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); /* Set up option menu callback and default item */ g_signal_connect (combo_box, "changed", diff --git a/tests/testtreeedit.c b/tests/testtreeedit.c index 784ee41a1a..58e433ae2a 100644 --- a/tests/testtreeedit.c +++ b/tests/testtreeedit.c @@ -208,7 +208,7 @@ create_control (GtkWidget *box, gint number, gint cntl, CallbackData *data) checkbutton = gtk_check_button_new_with_label (name); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), cntl == CNTL_FIXED); - gtk_box_pack_start (GTK_BOX (box), checkbutton); + gtk_container_add (GTK_CONTAINER (box), checkbutton); g_signal_connect (G_OBJECT (checkbutton), "toggled", callback, data); g_free (name); @@ -245,7 +245,7 @@ main (gint argc, gchar **argv) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (scrolled_window, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), scrolled_window); + gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); tree_model = create_model (); tree_view = gtk_tree_view_new_with_model (tree_model); @@ -350,11 +350,11 @@ main (gint argc, gchar **argv) 800, 250); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); /* Alignment controls */ cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox); + gtk_container_add (GTK_CONTAINER (hbox), cntl_vbox); create_control (cntl_vbox, 1, CNTL_ALIGN, &callback[0]); create_control (cntl_vbox, 2, CNTL_ALIGN, &callback[1]); @@ -363,7 +363,7 @@ main (gint argc, gchar **argv) /* Expand controls */ cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox); + gtk_container_add (GTK_CONTAINER (hbox), cntl_vbox); create_control (cntl_vbox, 1, CNTL_EXPAND, &callback[0]); create_control (cntl_vbox, 2, CNTL_EXPAND, &callback[1]); @@ -372,7 +372,7 @@ main (gint argc, gchar **argv) /* Fixed controls */ cntl_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - gtk_box_pack_start (GTK_BOX (hbox), cntl_vbox); + gtk_container_add (GTK_CONTAINER (hbox), cntl_vbox); create_control (cntl_vbox, 1, CNTL_FIXED, &callback[0]); create_control (cntl_vbox, 2, CNTL_FIXED, &callback[1]); diff --git a/tests/testtreeflow.c b/tests/testtreeflow.c index 6a6e4cca96..6155744595 100644 --- a/tests/testtreeflow.c +++ b/tests/testtreeflow.c @@ -134,14 +134,14 @@ main (int argc, char *argv[]) gtk_window_set_title (GTK_WINDOW (window), "Reflow test"); g_signal_connect (window, "destroy", gtk_main_quit, NULL); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Incremental Reflow Test")); + gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Incremental Reflow Test")); gtk_container_add (GTK_CONTAINER (window), vbox); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (scrolled_window, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), scrolled_window); + gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); initialize_model (); tree_view = gtk_tree_view_new_with_model (model); @@ -157,9 +157,9 @@ main (int argc, char *argv[]) NULL); gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox); + gtk_container_add (GTK_CONTAINER (vbox), hbox); button = gtk_button_new_with_mnemonic ("<b>_Futz!!</b>"); - gtk_box_pack_start (GTK_BOX (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), button); gtk_label_set_use_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (button))), TRUE); g_signal_connect (button, "clicked", G_CALLBACK (futz), NULL); g_signal_connect (button, "realize", G_CALLBACK (gtk_widget_grab_focus), NULL); diff --git a/tests/testtreefocus.c b/tests/testtreefocus.c index 5ba8a51cc3..65cebaf587 100644 --- a/tests/testtreefocus.c +++ b/tests/testtreefocus.c @@ -352,14 +352,14 @@ main (int argc, char *argv[]) gtk_window_set_title (GTK_WINDOW (window), "Card planning sheet"); g_signal_connect (window, "destroy", gtk_main_quit, NULL); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Jonathan's Holiday Card Planning Sheet")); + gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Jonathan's Holiday Card Planning Sheet")); gtk_container_add (GTK_CONTAINER (window), vbox); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (scrolled_window, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), scrolled_window); + gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); model = make_model (); tree_view = gtk_tree_view_new_with_model (model); @@ -467,14 +467,14 @@ main (int argc, char *argv[]) gtk_window_set_title (GTK_WINDOW (window), "Model"); g_signal_connect (window, "destroy", gtk_main_quit, NULL); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("The model revealed")); + gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("The model revealed")); gtk_container_add (GTK_CONTAINER (window), vbox); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (scrolled_window, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), scrolled_window); + gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); tree_view = gtk_tree_view_new_with_model (model); diff --git a/tests/testtreesort.c b/tests/testtreesort.c index 72aa83a7e0..35b6de9332 100644 --- a/tests/testtreesort.c +++ b/tests/testtreesort.c @@ -122,20 +122,20 @@ main (int argc, char *argv[]) gtk_window_set_title (GTK_WINDOW (window), "Words, words, words - Window 1"); g_signal_connect (window, "destroy", gtk_main_quit, NULL); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Jonathan and Kristian's list of cool words. (And Anders' cool list of numbers) \n\nThis is just a GtkTreeStore")); + gtk_container_add (GTK_CONTAINER (vbox), gtk_label_new ("Jonathan and Kristian's list of cool words. (And Anders' cool list of numbers) \n\nThis is just a GtkTreeStore")); gtk_container_add (GTK_CONTAINER (window), vbox); entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (vbox), entry); + gtk_container_add (GTK_CONTAINER (vbox), entry); button = gtk_button_new_with_label ("Switch search method"); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (scrolled_window, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), scrolled_window); + gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT); @@ -250,7 +250,7 @@ main (int argc, char *argv[]) "Words, words, words - window 2"); g_signal_connect (window2, "destroy", gtk_main_quit, NULL); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (vbox2), + gtk_container_add (GTK_CONTAINER (vbox2), gtk_label_new ("Jonathan and Kristian's list of words.\n\nA GtkTreeModelSort wrapping the GtkTreeStore of window 1")); gtk_container_add (GTK_CONTAINER (window2), vbox2); @@ -261,7 +261,7 @@ main (int argc, char *argv[]) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (scrolled_window2, TRUE); - gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window2); + gtk_container_add (GTK_CONTAINER (vbox2), scrolled_window2); tree_view2 = gtk_tree_view_new_with_model (smodel); @@ -319,7 +319,7 @@ main (int argc, char *argv[]) "Words, words, words - Window 3"); g_signal_connect (window3, "destroy", gtk_main_quit, NULL); vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_box_pack_start (GTK_BOX (vbox3), + gtk_container_add (GTK_CONTAINER (vbox3), gtk_label_new ("Jonathan and Kristian's list of words.\n\nA GtkTreeModelSort wrapping the GtkTreeModelSort of window 2")); gtk_container_add (GTK_CONTAINER (window3), vbox3); @@ -330,7 +330,7 @@ main (int argc, char *argv[]) GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_set_vexpand (scrolled_window3, TRUE); - gtk_box_pack_start (GTK_BOX (vbox3), scrolled_window3); + gtk_container_add (GTK_CONTAINER (vbox3), scrolled_window3); tree_view3 = gtk_tree_view_new_with_model (ssmodel); diff --git a/tests/testwindowsize.c b/tests/testwindowsize.c index e938072c33..9f7b029435 100644 --- a/tests/testwindowsize.c +++ b/tests/testwindowsize.c @@ -56,7 +56,7 @@ show_dialog (void) gtk_window_set_resizable (GTK_WINDOW (dialog), resizable); - gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), + gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), label); gtk_widget_show (label); diff --git a/tests/treestoretest.c b/tests/treestoretest.c index 34fcb07a8b..370bbdd111 100644 --- a/tests/treestoretest.c +++ b/tests/treestoretest.c @@ -329,7 +329,7 @@ make_window (gint view_type) /* Put them together */ gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view); gtk_widget_set_vexpand (scrolled_window, TRUE); - gtk_box_pack_start (GTK_BOX (vbox), scrolled_window); + gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, @@ -338,7 +338,7 @@ make_window (gint view_type) /* buttons */ button = gtk_button_new_with_label ("gtk_tree_store_remove"); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); g_signal_connect (selection, "changed", G_CALLBACK (selection_changed), button); @@ -350,9 +350,9 @@ make_window (gint view_type) button = gtk_button_new_with_label ("gtk_tree_store_insert"); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (vbox), hbox); - gtk_box_pack_start (GTK_BOX (hbox), button); - gtk_box_pack_start (GTK_BOX (hbox), entry); + gtk_container_add (GTK_CONTAINER (vbox), hbox); + gtk_container_add (GTK_CONTAINER (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), entry); g_object_set_data (G_OBJECT (button), "user_data", entry); g_signal_connect (button, "clicked", G_CALLBACK (iter_insert), @@ -361,9 +361,9 @@ make_window (gint view_type) button = gtk_button_new_with_label ("gtk_tree_store_set"); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (vbox), hbox); - gtk_box_pack_start (GTK_BOX (hbox), button); - gtk_box_pack_start (GTK_BOX (hbox), entry); + gtk_container_add (GTK_CONTAINER (vbox), hbox); + gtk_container_add (GTK_CONTAINER (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), entry); g_object_set_data (G_OBJECT (button), "user_data", entry); g_signal_connect (button, "clicked", G_CALLBACK (iter_change), @@ -372,16 +372,16 @@ make_window (gint view_type) button = gtk_button_new_with_label ("gtk_tree_store_insert_with_values"); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (vbox), hbox); - gtk_box_pack_start (GTK_BOX (hbox), button); - gtk_box_pack_start (GTK_BOX (hbox), entry); + gtk_container_add (GTK_CONTAINER (vbox), hbox); + gtk_container_add (GTK_CONTAINER (hbox), button); + gtk_container_add (GTK_CONTAINER (hbox), entry); g_object_set_data (G_OBJECT (button), "user_data", entry); g_signal_connect (button, "clicked", G_CALLBACK (iter_insert_with_values), tree_view); button = gtk_button_new_with_label ("gtk_tree_store_insert_before"); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (iter_insert_before), tree_view); @@ -391,7 +391,7 @@ make_window (gint view_type) gtk_widget_set_sensitive (button, FALSE); button = gtk_button_new_with_label ("gtk_tree_store_insert_after"); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (iter_insert_after), tree_view); @@ -401,13 +401,13 @@ make_window (gint view_type) gtk_widget_set_sensitive (button, FALSE); button = gtk_button_new_with_label ("gtk_tree_store_prepend"); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (iter_prepend), tree_view); button = gtk_button_new_with_label ("gtk_tree_store_append"); - gtk_box_pack_start (GTK_BOX (vbox), button); + gtk_container_add (GTK_CONTAINER (vbox), button); g_signal_connect (button, "clicked", G_CALLBACK (iter_append), tree_view); |