summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/gtk-demo/toolpalette.c6
-rw-r--r--docs/tools/widgets.c3
-rw-r--r--tests/a11y/children.c14
-rw-r--r--tests/prop-editor.c8
-rw-r--r--tests/testgtk.c6
-rw-r--r--tests/testkineticscrolling.c2
-rw-r--r--tests/testoverlaystyleclass.c3
7 files changed, 14 insertions, 28 deletions
diff --git a/demos/gtk-demo/toolpalette.c b/demos/gtk-demo/toolpalette.c
index 25d05eebc7..174e4afccc 100644
--- a/demos/gtk-demo/toolpalette.c
+++ b/demos/gtk-demo/toolpalette.c
@@ -575,8 +575,7 @@ do_toolpalette (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (contents_scroller),
- contents);
+ gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
@@ -606,8 +605,7 @@ do_toolpalette (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (contents_scroller),
- contents);
+ gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller,
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 03c19eaa69..1e70be074f 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1024,8 +1024,7 @@ create_scrolledwindow (void)
scrolledwin = gtk_scrolled_window_new (NULL, NULL);
label = gtk_label_new ("Scrolled Window");
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolledwin),
- label);
+ gtk_container_add (GTK_CONTAINER (scrolledwin), label);
return new_widget_info ("scrolledwindow", scrolledwin, MEDIUM);
}
diff --git a/tests/a11y/children.c b/tests/a11y/children.c
index dfd289484f..db1136b77d 100644
--- a/tests/a11y/children.c
+++ b/tests/a11y/children.c
@@ -39,7 +39,7 @@ test_scrolled_window_child_count (void)
g_object_ref_sink (sw);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), gtk_label_new ("Bla"));
+ gtk_container_add (GTK_CONTAINER (sw), gtk_label_new ("Bla"));
accessible = gtk_widget_get_accessible (sw);
g_assert_cmpint (atk_object_get_n_accessible_children (accessible), ==, 3);
@@ -66,16 +66,6 @@ children_changed (AtkObject *accessible,
}
static void
-add_child (GtkWidget *container,
- GtkWidget *child)
-{
- if (GTK_IS_SCROLLED_WINDOW (container))
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (container), child);
- else
- gtk_container_add (GTK_CONTAINER (container), child);
-}
-
-static void
remove_child (STATE *state,
gint i)
{
@@ -179,7 +169,7 @@ test_add_remove (GtkWidget *widget)
child_accessible = gtk_widget_get_accessible (state.child[i]);
g_signal_connect (child_accessible, "notify::accessible-parent",
G_CALLBACK (parent_notify), &(parent_data[i]));
- add_child (widget, state.child[i]);
+ gtk_container_add (GTK_CONTAINER (widget), state.child[i]);
}
else
child_accessible = atk_object_ref_accessible_child (accessible, i);
diff --git a/tests/prop-editor.c b/tests/prop-editor.c
index 7911d973ec..e9afe6f767 100644
--- a/tests/prop-editor.c
+++ b/tests/prop-editor.c
@@ -1146,7 +1146,7 @@ properties_from_type (GObject *object,
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), vbox);
+ gtk_container_add (GTK_CONTAINER (sw), vbox);
g_free (specs);
@@ -1220,7 +1220,7 @@ child_properties_from_object (GObject *object)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), vbox);
+ gtk_container_add (GTK_CONTAINER (sw), vbox);
g_free (specs);
@@ -1283,7 +1283,7 @@ children_from_object (GObject *object)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), vbox);
+ gtk_container_add (GTK_CONTAINER (sw), vbox);
g_list_free (children);
@@ -1339,7 +1339,7 @@ cells_from_object (GObject *object)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), vbox);
+ gtk_container_add (GTK_CONTAINER (sw), vbox);
g_list_free (cells);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 316d66c610..e7a199e970 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -3551,7 +3551,7 @@ create_scrolled_windows (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_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), grid);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), grid);
gtk_container_set_focus_hadjustment (GTK_CONTAINER (grid),
gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled_window)));
gtk_container_set_focus_vadjustment (GTK_CONTAINER (grid),
@@ -8719,7 +8719,7 @@ create_selection_test (GtkWidget *widget)
store = gtk_list_store_new (1, G_TYPE_STRING);
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_win), tree_view);
+ gtk_container_add (GTK_CONTAINER (scrolled_win), tree_view);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Target", renderer,
@@ -9750,7 +9750,7 @@ create_main_window (void)
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), box2);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), box2);
gtk_container_set_focus_vadjustment (GTK_CONTAINER (box2),
gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled_window)));
gtk_widget_show (box2);
diff --git a/tests/testkineticscrolling.c b/tests/testkineticscrolling.c
index 51cc5d05c1..dec82da878 100644
--- a/tests/testkineticscrolling.c
+++ b/tests/testkineticscrolling.c
@@ -69,7 +69,7 @@ kinetic_scrolling (void)
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_kinetic_scrolling (GTK_SCROLLED_WINDOW (swindow), TRUE);
gtk_scrolled_window_set_capture_button_press (GTK_SCROLLED_WINDOW (swindow), TRUE);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), button_grid);
+ gtk_container_add (GTK_CONTAINER (swindow), button_grid);
gtk_widget_show (button_grid);
gtk_grid_attach (GTK_GRID (grid), swindow, 0, 1, 1, 1);
diff --git a/tests/testoverlaystyleclass.c b/tests/testoverlaystyleclass.c
index e3b9f31874..911050e986 100644
--- a/tests/testoverlaystyleclass.c
+++ b/tests/testoverlaystyleclass.c
@@ -68,8 +68,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (overlay), sw);
main_child = gtk_event_box_new ();
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw),
- main_child);
+ gtk_container_add (GTK_CONTAINER (sw), main_child);
gdk_rgba_parse (&color, "green");
gtk_widget_override_background_color (main_child, 0, &color);
gtk_widget_set_hexpand (main_child, TRUE);