[gtk/bin-removal: 5/12] Use gtk_frame_set_child throughout
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/bin-removal: 5/12] Use gtk_frame_set_child throughout
- Date: Fri, 1 May 2020 20:57:54 +0000 (UTC)
commit 2c5f033d6e859b6373d1fd6fb141d55b5184d95b
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 1 13:41:22 2020 -0400
Use gtk_frame_set_child throughout
Replace all uses of gtk_container_add for
frames with gtk_frame_set_child.
demos/constraint-editor/constraint-view.c | 4 +-
demos/gtk-demo/combobox.c | 8 ++--
demos/gtk-demo/dialog.c | 2 +-
demos/gtk-demo/drawingarea.c | 4 +-
demos/gtk-demo/gears.c | 2 +-
demos/gtk-demo/images.c | 10 ++---
demos/gtk-demo/infobar.c | 2 +-
demos/gtk-demo/panes.c | 4 +-
demos/gtk-demo/sizegroup.c | 4 +-
demos/gtk-demo/textview.c | 2 +-
docs/tools/widgets.c | 2 +-
examples/drawing.c | 2 +-
gtk/gtkcustompaperunixdialog.c | 4 +-
gtk/gtkentrycompletion.c | 2 +-
gtk/gtkprintunixdialog.c | 4 +-
gtk/gtktreeviewcolumn.c | 21 ++++------
gtk/inspector/size-groups.c | 2 +-
tests/gdkgears.c | 5 +--
tests/testadjustsize.c | 2 +-
tests/testcalendar.c | 2 +-
tests/testcellarea.c | 7 ++--
tests/testfilechooserbutton.c | 2 +-
tests/testflowbox.c | 6 +--
tests/testframe.c | 2 +-
tests/testgtk.c | 70 +++++++++++++++----------------
tests/testscale.c | 16 +++----
tests/testscrolledwindow.c | 2 +-
tests/testtoolbar2.c | 2 +-
28 files changed, 94 insertions(+), 101 deletions(-)
---
diff --git a/demos/constraint-editor/constraint-view.c b/demos/constraint-editor/constraint-view.c
index 141a40327c..d1ea9c9401 100644
--- a/demos/constraint-editor/constraint-view.c
+++ b/demos/constraint-editor/constraint-view.c
@@ -216,7 +216,7 @@ constraint_view_add_child (ConstraintView *view,
frame = gtk_frame_new (NULL);
gtk_widget_add_css_class (frame, "child");
gtk_widget_set_name (frame, name);
- gtk_container_add (GTK_CONTAINER (frame), label);
+ gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_widget_set_parent (frame, GTK_WIDGET (view));
update_weak_position (view, frame, 100, 100);
@@ -259,7 +259,7 @@ constraint_view_add_guide (ConstraintView *view,
frame = gtk_frame_new (NULL);
gtk_widget_add_css_class (frame, "guide");
g_object_set_data (G_OBJECT (frame), "internal", (char *)"yes");
- gtk_container_add (GTK_CONTAINER (frame), label);
+ gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_widget_insert_after (frame, GTK_WIDGET (view), NULL);
g_object_set_data (G_OBJECT (guide), "frame", frame);
diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c
index 47d61f079f..e2e9d11f95 100644
--- a/demos/gtk-demo/combobox.c
+++ b/demos/gtk-demo/combobox.c
@@ -337,7 +337,7 @@ do_combobox (GtkWidget *do_widget)
gtk_widget_set_margin_end (box, 5);
gtk_widget_set_margin_top (box, 5);
gtk_widget_set_margin_bottom (box, 5);
- gtk_container_add (GTK_CONTAINER (frame), box);
+ gtk_frame_set_child (GTK_FRAME (frame), box);
model = create_icon_store ();
combo = gtk_combo_box_new_with_model (model);
@@ -381,7 +381,7 @@ do_combobox (GtkWidget *do_widget)
gtk_widget_set_margin_end (box, 5);
gtk_widget_set_margin_top (box, 5);
gtk_widget_set_margin_bottom (box, 5);
- gtk_container_add (GTK_CONTAINER (frame), box);
+ gtk_frame_set_child (GTK_FRAME (frame), box);
model = create_capital_store ();
combo = gtk_combo_box_new_with_model (model);
@@ -412,7 +412,7 @@ do_combobox (GtkWidget *do_widget)
gtk_widget_set_margin_end (box, 5);
gtk_widget_set_margin_top (box, 5);
gtk_widget_set_margin_bottom (box, 5);
- gtk_container_add (GTK_CONTAINER (frame), box);
+ gtk_frame_set_child (GTK_FRAME (frame), box);
combo = gtk_combo_box_text_new_with_entry ();
fill_combo_entry (combo);
@@ -433,7 +433,7 @@ do_combobox (GtkWidget *do_widget)
gtk_widget_set_margin_end (box, 5);
gtk_widget_set_margin_top (box, 5);
gtk_widget_set_margin_bottom (box, 5);
- gtk_container_add (GTK_CONTAINER (frame), box);
+ gtk_frame_set_child (GTK_FRAME (frame), box);
combo = gtk_combo_box_text_new ();
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "never", "Not visible");
diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c
index 2313b6f255..92a4e3371c 100644
--- a/demos/gtk-demo/dialog.c
+++ b/demos/gtk-demo/dialog.c
@@ -125,7 +125,7 @@ do_dialog (GtkWidget *do_widget)
gtk_widget_set_margin_end (vbox, 8);
gtk_widget_set_margin_top (vbox, 8);
gtk_widget_set_margin_bottom (vbox, 8);
- gtk_container_add (GTK_CONTAINER (frame), vbox);
+ gtk_frame_set_child (GTK_FRAME (frame), vbox);
/* Standard message dialog */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c
index bbbe145524..845b414834 100644
--- a/demos/gtk-demo/drawingarea.c
+++ b/demos/gtk-demo/drawingarea.c
@@ -221,7 +221,7 @@ do_drawingarea (GtkWidget *do_widget)
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), checkerboard_draw, NULL, NULL);
- gtk_container_add (GTK_CONTAINER (frame), da);
+ gtk_frame_set_child (GTK_FRAME (frame), da);
/*
* Create the scribble area
@@ -240,7 +240,7 @@ do_drawingarea (GtkWidget *do_widget)
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), scribble_draw, NULL, NULL);
- gtk_container_add (GTK_CONTAINER (frame), da);
+ gtk_frame_set_child (GTK_FRAME (frame), da);
g_signal_connect (da, "size-allocate",
G_CALLBACK (scribble_size_allocate), NULL);
diff --git a/demos/gtk-demo/gears.c b/demos/gtk-demo/gears.c
index b1f58e8840..66fb2b420f 100644
--- a/demos/gtk-demo/gears.c
+++ b/demos/gtk-demo/gears.c
@@ -103,7 +103,7 @@ do_gears (GtkWidget *do_widget)
fps_label = gtk_label_new ("");
gtk_widget_set_halign (fps_label, GTK_ALIGN_START);
- gtk_container_add (GTK_CONTAINER (frame), fps_label);
+ gtk_frame_set_child (GTK_FRAME (frame), fps_label);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
gtk_box_set_spacing (GTK_BOX (box), 6);
diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c
index 3e476ce1b2..455343a933 100644
--- a/demos/gtk-demo/images.c
+++ b/demos/gtk-demo/images.c
@@ -367,7 +367,7 @@ do_images (GtkWidget *do_widget)
image = gtk_image_new_from_icon_name ("gtk3-demo");
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
- gtk_container_add (GTK_CONTAINER (frame), image);
+ gtk_frame_set_child (GTK_FRAME (frame), image);
/* Animation */
@@ -384,7 +384,7 @@ do_images (GtkWidget *do_widget)
picture = gtk_picture_new_for_resource ("/images/floppybuddy.gif");
- gtk_container_add (GTK_CONTAINER (frame), picture);
+ gtk_frame_set_child (GTK_FRAME (frame), picture);
/* Symbolic icon */
@@ -402,7 +402,7 @@ do_images (GtkWidget *do_widget)
image = gtk_image_new_from_gicon (gicon);
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
- gtk_container_add (GTK_CONTAINER (frame), image);
+ gtk_frame_set_child (GTK_FRAME (frame), image);
/* Progressive */
@@ -423,7 +423,7 @@ do_images (GtkWidget *do_widget)
* will create the pixbuf and fill it in.
*/
picture = gtk_picture_new ();
- gtk_container_add (GTK_CONTAINER (frame), picture);
+ gtk_frame_set_child (GTK_FRAME (frame), picture);
start_progressive_loading (picture);
@@ -443,7 +443,7 @@ do_images (GtkWidget *do_widget)
video = gtk_video_new_for_resource ("/images/gtk-logo.webm");
gtk_media_stream_set_loop (gtk_video_get_media_stream (GTK_VIDEO (video)), TRUE);
- gtk_container_add (GTK_CONTAINER (frame), video);
+ gtk_frame_set_child (GTK_FRAME (frame), video);
/* Widget paintables */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
diff --git a/demos/gtk-demo/infobar.c b/demos/gtk-demo/infobar.c
index 2f2cecf63b..c6f744c2ab 100644
--- a/demos/gtk-demo/infobar.c
+++ b/demos/gtk-demo/infobar.c
@@ -143,7 +143,7 @@ do_infobar (GtkWidget *do_widget)
gtk_widget_set_margin_end (actions, 8);
gtk_widget_set_margin_top (actions, 8);
gtk_widget_set_margin_bottom (actions, 8);
- gtk_container_add (GTK_CONTAINER (frame), actions);
+ gtk_frame_set_child (GTK_FRAME (frame), actions);
}
if (!gtk_widget_get_visible (window))
diff --git a/demos/gtk-demo/panes.c b/demos/gtk-demo/panes.c
index 9ed83509ee..98ce0fd664 100644
--- a/demos/gtk-demo/panes.c
+++ b/demos/gtk-demo/panes.c
@@ -103,7 +103,7 @@ create_pane_options (GtkPaned *paned,
gtk_widget_set_margin_bottom (frame, 4);
table = gtk_grid_new ();
- gtk_container_add (GTK_CONTAINER (frame), table);
+ gtk_frame_set_child (GTK_FRAME (frame), table);
label = gtk_label_new (label1);
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
@@ -176,7 +176,7 @@ do_panes (GtkWidget *do_widget)
gtk_paned_add1 (GTK_PANED (hpaned), frame);
button = gtk_button_new_with_mnemonic ("_Hi there");
- gtk_container_add (GTK_CONTAINER(frame), button);
+ gtk_frame_set_child (GTK_FRAME (frame), button);
frame = gtk_frame_new (NULL);
gtk_widget_set_size_request (frame, 80, 60);
diff --git a/demos/gtk-demo/sizegroup.c b/demos/gtk-demo/sizegroup.c
index 07cbba955e..edbf9e9cf2 100644
--- a/demos/gtk-demo/sizegroup.c
+++ b/demos/gtk-demo/sizegroup.c
@@ -128,7 +128,7 @@ do_sizegroup (GtkWidget *do_widget)
gtk_widget_set_margin_bottom (table, 5);
gtk_grid_set_row_spacing (GTK_GRID (table), 5);
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
- gtk_container_add (GTK_CONTAINER (frame), table);
+ gtk_frame_set_child (GTK_FRAME (frame), table);
add_row (GTK_GRID (table), 0, size_group, "_Foreground", color_options);
add_row (GTK_GRID (table), 1, size_group, "_Background", color_options);
@@ -144,7 +144,7 @@ do_sizegroup (GtkWidget *do_widget)
gtk_widget_set_margin_bottom (table, 5);
gtk_grid_set_row_spacing (GTK_GRID (table), 5);
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
- gtk_container_add (GTK_CONTAINER (frame), table);
+ gtk_frame_set_child (GTK_FRAME (frame), table);
add_row (GTK_GRID (table), 0, size_group, "_Dashing", dash_options);
add_row (GTK_GRID (table), 1, size_group, "_Line ends", end_options);
diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c
index 1810251c36..d5aed9b08b 100644
--- a/demos/gtk-demo/textview.c
+++ b/demos/gtk-demo/textview.c
@@ -547,7 +547,7 @@ recursive_attach_view (int depth,
/* Frame is to add a black border around each child view */
frame = gtk_frame_new (NULL);
- gtk_container_add (GTK_CONTAINER (frame), child_view);
+ gtk_frame_set_child (GTK_FRAME (frame), child_view);
gtk_text_view_add_child_at_anchor (view, frame, anchor);
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index c6f088f47f..683e5dfda4 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1233,7 +1233,7 @@ create_sidebar (void)
gtk_container_add (GTK_CONTAINER (hbox), sidebar);
gtk_container_add (GTK_CONTAINER (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL));
gtk_container_add (GTK_CONTAINER (hbox), stack);
- gtk_container_add (GTK_CONTAINER (frame), hbox);
+ gtk_frame_set_child (GTK_FRAME (frame), hbox);
return new_widget_info ("sidebar", frame, ASIS);
}
diff --git a/examples/drawing.c b/examples/drawing.c
index 37c439c904..e00460889f 100644
--- a/examples/drawing.c
+++ b/examples/drawing.c
@@ -149,7 +149,7 @@ activate (GtkApplication *app,
/* set a minimum size */
gtk_widget_set_size_request (drawing_area, 100, 100);
- gtk_container_add (GTK_CONTAINER (frame), drawing_area);
+ gtk_frame_set_child (GTK_FRAME (frame), drawing_area);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area), draw_cb, NULL, NULL);
diff --git a/gtk/gtkcustompaperunixdialog.c b/gtk/gtkcustompaperunixdialog.c
index 92c15b14df..d6a87cdf6f 100644
--- a/gtk/gtkcustompaperunixdialog.c
+++ b/gtk/gtkcustompaperunixdialog.c
@@ -977,13 +977,13 @@ wrap_in_frame (const gchar *label,
g_free (bold_text);
frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
- gtk_container_add (GTK_CONTAINER (frame), label_widget);
+ gtk_frame_set_child (GTK_FRAME (frame), label_widget);
gtk_widget_set_margin_start (child, 12);
gtk_widget_set_halign (child, GTK_ALIGN_FILL);
gtk_widget_set_valign (child, GTK_ALIGN_FILL);
- gtk_container_add (GTK_CONTAINER (frame), child);
+ gtk_frame_set_child (GTK_FRAME (frame), child);
gtk_widget_show (frame);
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 0803dc6173..6191717f16 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -603,7 +603,7 @@ gtk_entry_completion_constructed (GObject *object)
gtk_container_add (GTK_CONTAINER (priv->popup_window), popup_frame);
priv->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (popup_frame), priv->vbox);
+ gtk_frame_set_child (GTK_FRAME (popup_frame), priv->vbox);
gtk_container_add (GTK_CONTAINER (priv->scrolled_window), priv->tree_view);
gtk_widget_set_hexpand (priv->scrolled_window, TRUE);
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index aae3b0d4b4..28f661f096 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -1292,13 +1292,13 @@ wrap_in_frame (const gchar *label,
g_free (bold_text);
frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
- gtk_container_add (GTK_CONTAINER (frame), label_widget);
+ gtk_frame_set_child (GTK_FRAME (frame), label_widget);
gtk_widget_set_margin_start (child, 12);
gtk_widget_set_halign (child, GTK_ALIGN_FILL);
gtk_widget_set_valign (child, GTK_ALIGN_FILL);
- gtk_container_add (GTK_CONTAINER (frame), child);
+ gtk_frame_set_child (GTK_FRAME (frame), child);
gtk_widget_show (frame);
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 75dface61c..a9dc35e2bd 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -25,6 +25,7 @@
#include "gtkcellareacontext.h"
#include "gtkcelllayout.h"
#include "gtkdragsource.h"
+#include "gtkframe.h"
#include "gtkimage.h"
#include "gtkintl.h"
#include "gtklabel.h"
@@ -925,22 +926,16 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
if (priv->child)
{
if (current_child != priv->child)
- {
- gtk_container_remove (GTK_CONTAINER (frame),
- current_child);
- gtk_container_add (GTK_CONTAINER (frame),
- priv->child);
- }
+ gtk_frame_set_child (GTK_FRAME (frame), priv->child);
}
- else
+ else
{
if (current_child == NULL)
- {
- current_child = gtk_label_new (NULL);
- gtk_widget_show (current_child);
- gtk_container_add (GTK_CONTAINER (frame),
- current_child);
- }
+ {
+ current_child = gtk_label_new (NULL);
+ gtk_widget_show (current_child);
+ gtk_frame_set_child (GTK_FRAME (frame), current_child);
+ }
g_return_if_fail (GTK_IS_LABEL (current_child));
diff --git a/gtk/inspector/size-groups.c b/gtk/inspector/size-groups.c
index 6fbf202763..10d3d24286 100644
--- a/gtk/inspector/size-groups.c
+++ b/gtk/inspector/size-groups.c
@@ -231,7 +231,7 @@ add_size_group (GtkInspectorSizeGroups *sl,
gtk_container_add (GTK_CONTAINER (sl), frame);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_add_css_class (box, GTK_STYLE_CLASS_VIEW);
- gtk_container_add (GTK_CONTAINER (frame), box);
+ gtk_frame_set_child (GTK_FRAME (frame), box);
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_container_add (GTK_CONTAINER (box), box2);
diff --git a/tests/gdkgears.c b/tests/gdkgears.c
index 7eb650528a..a4613a484e 100644
--- a/tests/gdkgears.c
+++ b/tests/gdkgears.c
@@ -146,8 +146,7 @@ main (int argc, char *argv[])
revealer = gtk_revealer_new ();
gtk_widget_set_halign (revealer, GTK_ALIGN_END);
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
- gtk_overlay_add_overlay (GTK_OVERLAY (overlay),
- revealer);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), revealer);
gtk_widget_show (revealer);
frame = gtk_frame_new (NULL);
@@ -157,7 +156,7 @@ main (int argc, char *argv[])
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
gtk_box_set_spacing (GTK_BOX (hbox), 6);
- gtk_container_add (GTK_CONTAINER (frame), hbox);
+ gtk_frame_set_child (GTK_FRAME (frame), hbox);
gtk_widget_show (hbox);
label = gtk_label_new ("This is a transparent overlay widget!!!!\nAmazing, eh?");
diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c
index bbe033417d..bdb506ee86 100644
--- a/tests/testadjustsize.c
+++ b/tests/testadjustsize.c
@@ -347,7 +347,7 @@ open_valigned_label_window (void)
frame = gtk_frame_new (NULL);
gtk_widget_show (frame);
- gtk_container_add (GTK_CONTAINER (frame), label);
+ gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
diff --git a/tests/testcalendar.c b/tests/testcalendar.c
index da6af0daa3..c453f7bec3 100644
--- a/tests/testcalendar.c
+++ b/tests/testcalendar.c
@@ -157,7 +157,7 @@ create_frame (const char *caption,
NULL);
gtk_label_set_markup (GTK_LABEL (label), caption);
- gtk_container_add (GTK_CONTAINER (frame), child);
+ gtk_frame_set_child (GTK_FRAME (frame), child);
return frame;
}
diff --git a/tests/testcellarea.c b/tests/testcellarea.c
index 7a4ea6b88f..9e538ac53a 100644
--- a/tests/testcellarea.c
+++ b/tests/testcellarea.c
@@ -193,7 +193,7 @@ simple_cell_area (void)
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
- gtk_container_add (GTK_CONTAINER (frame), iconview);
+ gtk_frame_set_child (GTK_FRAME (frame), iconview);
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
@@ -437,7 +437,7 @@ focus_cell_area (void)
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
- gtk_container_add (GTK_CONTAINER (frame), iconview);
+ gtk_frame_set_child (GTK_FRAME (frame), iconview);
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
@@ -536,8 +536,7 @@ background_area (void)
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
- gtk_container_add (GTK_CONTAINER (frame), iconview);
-
+ gtk_frame_set_child (GTK_FRAME (frame), iconview);
/* Now add some controls */
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c
index db4d7ca56a..196cebf764 100644
--- a/tests/testfilechooserbutton.c
+++ b/tests/testfilechooserbutton.c
@@ -321,7 +321,7 @@ main (int argc,
label_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
group_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
- gtk_container_add (GTK_CONTAINER (frame), group_box);
+ gtk_frame_set_child (GTK_FRAME (frame), group_box);
/* OPEN */
add_new_filechooser_button ("_Open:", "Select A File",
diff --git a/tests/testflowbox.c b/tests/testflowbox.c
index c50193d76a..14b274acb0 100644
--- a/tests/testflowbox.c
+++ b/tests/testflowbox.c
@@ -51,7 +51,7 @@ populate_flowbox_simple (GtkFlowBox *flowbox)
gtk_widget_show (widget);
gtk_widget_show (frame);
- gtk_container_add (GTK_CONTAINER (frame), widget);
+ gtk_frame_set_child (GTK_FRAME (frame), widget);
g_object_set_data_full (G_OBJECT (frame), "id", (gpointer)g_strdup (text), g_free);
gtk_container_add (GTK_CONTAINER (flowbox), frame);
@@ -73,7 +73,7 @@ populate_flowbox_focus (GtkFlowBox *flowbox)
frame = gtk_frame_new (NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_container_add (GTK_CONTAINER (frame), box);
+ gtk_frame_set_child (GTK_FRAME (frame), box);
widget = gtk_label_new ("Label");
gtk_container_add (GTK_CONTAINER (box), widget);
@@ -146,7 +146,7 @@ populate_flowbox_wrappy (GtkFlowBox *flowbox)
gtk_widget_show (widget);
gtk_widget_show (frame);
- gtk_container_add (GTK_CONTAINER (frame), widget);
+ gtk_frame_set_child (GTK_FRAME (frame), widget);
gtk_label_set_wrap (GTK_LABEL (widget), TRUE);
gtk_label_set_wrap_mode (GTK_LABEL (widget), PANGO_WRAP_WORD);
diff --git a/tests/testframe.c b/tests/testframe.c
index 750b6f9ff4..06b69d38f6 100644
--- a/tests/testframe.c
+++ b/tests/testframe.c
@@ -154,7 +154,7 @@ int main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (frame));
widget = gtk_button_new_with_label ("Hello!");
- gtk_container_add (GTK_CONTAINER (frame), widget);
+ gtk_frame_set_child (GTK_FRAME (frame), widget);
grid = GTK_GRID (gtk_grid_new ());
gtk_grid_set_row_spacing (grid, 12);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index a76fe0e53f..bd07c664f3 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -960,27 +960,27 @@ static void create_labels (GtkWidget *widget)
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_frame_set_child (GTK_FRAME (frame), label);
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_frame_set_child (GTK_FRAME (frame), label);
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_frame_set_child (GTK_FRAME (frame), label);
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_frame_set_child (GTK_FRAME (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame);
frame = gtk_frame_new ("Internationalized Label");
@@ -993,13 +993,13 @@ static void create_labels (GtkWidget *widget)
"Chinese (Traditional) <span lang=\"zh-tw\">\345\205\203\346\260\243
\351\226\213\347\231\274</span>\n"
"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_frame_set_child (GTK_FRAME (frame), label);
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_frame_set_child (GTK_FRAME (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame);
frame = gtk_frame_new ("Links in a label");
@@ -1007,7 +1007,7 @@ static void create_labels (GtkWidget *widget)
"as hyperlinks, which can be clicked\n"
"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_frame_set_child (GTK_FRAME (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame);
g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL);
@@ -1023,7 +1023,7 @@ static void create_labels (GtkWidget *widget)
"many extra spaces. ");
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
- gtk_container_add (GTK_CONTAINER (frame), label);
+ gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame);
frame = gtk_frame_new ("Filled, wrapped label");
@@ -1036,14 +1036,14 @@ static void create_labels (GtkWidget *widget)
"unfortunately.");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_FILL);
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
- gtk_container_add (GTK_CONTAINER (frame), label);
+ gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame);
frame = gtk_frame_new ("Underlined label");
label = gtk_label_new ("This label is underlined!\n"
"This one is underlined
(\343\201\223\343\202\223\343\201\253\343\201\241\343\201\257) in quite a funky fashion");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_container_add (GTK_CONTAINER (frame), label);
+ gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame);
frame = gtk_frame_new ("Markup label");
@@ -1070,7 +1070,7 @@ static 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_frame_set_child (GTK_FRAME (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame);
}
@@ -1352,7 +1352,7 @@ create_tooltips (GtkWidget *widget)
"label_xalign", (double) 0.5,
NULL);
gtk_container_add (GTK_CONTAINER (box2), frame);
- gtk_container_add (GTK_CONTAINER (frame), box3);
+ gtk_frame_set_child (GTK_FRAME (frame), box3);
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (box1), separator);
@@ -1789,7 +1789,7 @@ create_modal_window (GtkWidget *widget)
/* Pack widgets */
gtk_container_add (GTK_CONTAINER (window), box1);
gtk_container_add (GTK_CONTAINER (box1), frame1);
- gtk_container_add (GTK_CONTAINER (frame1), box2);
+ gtk_frame_set_child (GTK_FRAME (frame1), box2);
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));
@@ -2628,7 +2628,7 @@ create_spins (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (main_vbox), frame);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (frame), vbox);
+ gtk_frame_set_child (GTK_FRAME (frame), vbox);
/* Time, month, hex spinners */
@@ -2706,7 +2706,7 @@ create_spins (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (main_vbox), frame);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (frame), vbox);
+ gtk_frame_set_child (GTK_FRAME (frame), vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
@@ -2783,7 +2783,7 @@ create_spins (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (main_vbox), frame);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_add (GTK_CONTAINER (frame), hbox);
+ gtk_frame_set_child (GTK_FRAME (frame), vbox);
val_label = gtk_label_new ("0.0");
@@ -3134,7 +3134,7 @@ create_cursors (GtkWidget *widget)
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (darea), 80);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (darea), 80);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (darea), cursor_draw, NULL, NULL);
- gtk_container_add (GTK_CONTAINER (frame), darea);
+ gtk_frame_set_child (GTK_FRAME (frame), darea);
gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "pressed", G_CALLBACK (cursor_pressed_cb), entry);
@@ -3277,7 +3277,7 @@ create_forward_back (const char *title,
GtkWidget *back_button = gtk_button_new_with_label ("Back");
GtkWidget *forward_button = gtk_button_new_with_label ("Forward");
- gtk_container_add (GTK_CONTAINER (frame), bbox);
+ gtk_frame_set_child (GTK_FRAME (frame), bbox);
gtk_container_add (GTK_CONTAINER (bbox), back_button);
gtk_container_add (GTK_CONTAINER (bbox), forward_button);
@@ -3563,7 +3563,7 @@ create_display_screen (GtkWidget *widget)
gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
gtk_grid_set_column_spacing (GTK_GRID (grid), 3);
- gtk_container_add (GTK_CONTAINER (frame), grid);
+ gtk_frame_set_child (GTK_FRAME (frame), grid);
label_dpy = gtk_label_new ("move to another X display");
combo_dpy = gtk_combo_box_text_new_with_entry ();
@@ -4152,7 +4152,7 @@ create_pane_options (GtkPaned *paned,
frame = gtk_frame_new (frame_label);
grid = gtk_grid_new ();
- gtk_container_add (GTK_CONTAINER (frame), grid);
+ gtk_frame_set_child (GTK_FRAME (frame), grid);
label = gtk_label_new (label1);
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
@@ -4230,7 +4230,7 @@ create_panes (GtkWidget *widget)
gtk_paned_add1 (GTK_PANED (hpaned), frame);
button = gtk_button_new_with_label ("Hi there");
- gtk_container_add (GTK_CONTAINER(frame), button);
+ gtk_frame_set_child (GTK_FRAME (frame), button);
frame = gtk_frame_new (NULL);
gtk_widget_set_size_request (frame, 80, 60);
@@ -4303,7 +4303,7 @@ paned_keyboard_window1 (GtkWidget *widget)
gtk_paned_pack1 (GTK_PANED (hpaned1), frame1, FALSE, TRUE);
vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (frame1), vbox1);
+ gtk_frame_set_child (GTK_FRAME (frame1), vbox1);
button7 = gtk_button_new_with_label ("button7");
gtk_container_add (GTK_CONTAINER (vbox1), button7);
@@ -4321,10 +4321,10 @@ paned_keyboard_window1 (GtkWidget *widget)
gtk_paned_pack1 (GTK_PANED (vpaned1), frame2, FALSE, TRUE);
frame5 = gtk_frame_new (NULL);
- gtk_container_add (GTK_CONTAINER (frame2), frame5);
+ gtk_frame_set_child (GTK_FRAME (frame2), frame5);
hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_add (GTK_CONTAINER (frame5), hbox1);
+ gtk_frame_set_child (GTK_FRAME (frame5), hbox1);
button5 = gtk_button_new_with_label ("button5");
gtk_container_add (GTK_CONTAINER (hbox1), button5);
@@ -4336,10 +4336,10 @@ paned_keyboard_window1 (GtkWidget *widget)
gtk_paned_pack2 (GTK_PANED (vpaned1), frame3, TRUE, TRUE);
frame4 = gtk_frame_new ("Buttons");
- gtk_container_add (GTK_CONTAINER (frame3), frame4);
+ gtk_frame_set_child (GTK_FRAME (frame3), frame4);
grid1 = gtk_grid_new ();
- gtk_container_add (GTK_CONTAINER (frame4), grid1);
+ gtk_frame_set_child (GTK_FRAME (frame4), grid1);
button1 = gtk_button_new_with_label ("button1");
gtk_grid_attach (GTK_GRID (grid1), button1, 0, 0, 1, 1);
@@ -4384,7 +4384,7 @@ paned_keyboard_window2 (GtkWidget *widget)
gtk_paned_pack1 (GTK_PANED (hpaned2), frame6, FALSE, TRUE);
button13 = gtk_button_new_with_label ("button13");
- gtk_container_add (GTK_CONTAINER (frame6), button13);
+ gtk_frame_set_child (GTK_FRAME (frame6), button13);
hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_paned_pack2 (GTK_PANED (hpaned2), hbox2, TRUE, TRUE);
@@ -4396,13 +4396,13 @@ paned_keyboard_window2 (GtkWidget *widget)
gtk_paned_pack1 (GTK_PANED (vpaned2), frame7, FALSE, TRUE);
button12 = gtk_button_new_with_label ("button12");
- gtk_container_add (GTK_CONTAINER (frame7), button12);
+ gtk_frame_set_child (GTK_FRAME (frame7), button12);
frame8 = gtk_frame_new (NULL);
gtk_paned_pack2 (GTK_PANED (vpaned2), frame8, TRUE, TRUE);
button11 = gtk_button_new_with_label ("button11");
- gtk_container_add (GTK_CONTAINER (frame8), button11);
+ gtk_frame_set_child (GTK_FRAME (frame8), button11);
button10 = gtk_button_new_with_label ("button10");
gtk_container_add (GTK_CONTAINER (hbox2), button10);
@@ -4449,7 +4449,7 @@ paned_keyboard_window3 (GtkWidget *widget)
gtk_paned_pack1 (GTK_PANED (hpaned3), frame9, FALSE, TRUE);
button14 = gtk_button_new_with_label ("button14");
- gtk_container_add (GTK_CONTAINER (frame9), button14);
+ gtk_frame_set_child (GTK_FRAME (frame9), button14);
hpaned4 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_pack2 (GTK_PANED (hpaned3), hpaned4, TRUE, TRUE);
@@ -4458,7 +4458,7 @@ paned_keyboard_window3 (GtkWidget *widget)
gtk_paned_pack1 (GTK_PANED (hpaned4), frame10, FALSE, TRUE);
button15 = gtk_button_new_with_label ("button15");
- gtk_container_add (GTK_CONTAINER (frame10), button15);
+ gtk_frame_set_child (GTK_FRAME (frame10), button15);
hpaned5 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_pack2 (GTK_PANED (hpaned4), hpaned5, TRUE, TRUE);
@@ -4467,13 +4467,13 @@ paned_keyboard_window3 (GtkWidget *widget)
gtk_paned_pack1 (GTK_PANED (hpaned5), frame11, FALSE, TRUE);
button16 = gtk_button_new_with_label ("button16");
- gtk_container_add (GTK_CONTAINER (frame11), button16);
+ gtk_frame_set_child (GTK_FRAME (frame11), button16);
frame12 = gtk_frame_new (NULL);
gtk_paned_pack2 (GTK_PANED (hpaned5), frame12, TRUE, TRUE);
button17 = gtk_button_new_with_label ("button17");
- gtk_container_add (GTK_CONTAINER (frame12), button17);
+ gtk_frame_set_child (GTK_FRAME (frame12), button17);
return window3;
}
@@ -5407,7 +5407,7 @@ create_progress_bar (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (vbox), frame);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
- gtk_container_add (GTK_CONTAINER (frame), vbox2);
+ gtk_frame_set_child (GTK_FRAME (frame), vbox2);
pdata->pbar = gtk_progress_bar_new ();
gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (pdata->pbar),
@@ -5429,7 +5429,7 @@ create_progress_bar (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (vbox), frame);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
- gtk_container_add (GTK_CONTAINER (frame), vbox2);
+ gtk_frame_set_child (GTK_FRAME (frame), vbox2);
grid = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (grid), 10);
diff --git a/tests/testscale.c b/tests/testscale.c
index cc93076002..735ac6474c 100644
--- a/tests/testscale.c
+++ b/tests/testscale.c
@@ -142,7 +142,7 @@ int main (int argc, char *argv[])
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
scales = g_slist_prepend (scales, scale);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
- gtk_container_add (GTK_CONTAINER (frame), scale);
+ gtk_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("With fill level");
@@ -151,7 +151,7 @@ int main (int argc, char *argv[])
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
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_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Simple marks");
@@ -161,7 +161,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_BOTTOM, NULL);
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_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Simple marks up");
@@ -171,7 +171,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_TOP, NULL);
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_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Labeled marks");
@@ -183,7 +183,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_BOTTOM, labels[0]);
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_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Some labels");
@@ -193,7 +193,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_TOP, labels[0]);
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_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Above and below");
@@ -204,7 +204,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[1], GTK_POS_BOTTOM, bath_labels[1]);
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_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
frame = gtk_frame_new ("Positions");
@@ -215,7 +215,7 @@ int main (int argc, char *argv[])
gtk_scale_add_mark (GTK_SCALE (scale), pos_marks[1], GTK_POS_RIGHT, pos_labels[1]);
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_frame_set_child (GTK_FRAME (frame), scale);
gtk_container_add (GTK_CONTAINER (box), frame);
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c
index 2e81b31683..a03851f954 100644
--- a/tests/testscrolledwindow.c
+++ b/tests/testscrolledwindow.c
@@ -101,7 +101,7 @@ scrollable_policy (void)
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_show (swindow);
- gtk_container_add (GTK_CONTAINER (frame), swindow);
+ gtk_frame_set_child (GTK_FRAME (frame), swindow);
viewport = gtk_viewport_new (NULL, NULL);
label = gtk_label_new ("Here is a wrapping label with a minimum width-chars of 40 and "
diff --git a/tests/testtoolbar2.c b/tests/testtoolbar2.c
index 64b83e5ca2..82f8918e3d 100644
--- a/tests/testtoolbar2.c
+++ b/tests/testtoolbar2.c
@@ -34,7 +34,7 @@ int main (int argc, char *argv[])
button = gtk_button_new_from_icon_name ("document-save-symbolic");
gtk_container_add (GTK_CONTAINER (box3), button);
- gtk_container_add (GTK_CONTAINER (frame), box3);
+ gtk_frame_set_child (GTK_FRAME (frame), box3);
gtk_widget_show (GTK_WIDGET (window));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]