[gtk/bin-removal: 9/44] Use gtk_viewport_set_child throughout
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/bin-removal: 9/44] Use gtk_viewport_set_child throughout
- Date: Sun, 3 May 2020 15:56:03 +0000 (UTC)
commit 8e032ed77f5bede42e07879b5d7bcebf298024ca
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 1 15:43:09 2020 -0400
Use gtk_viewport_set_child throughout
Replace all uses of gtk_container_add on viewports
by gtk_viewport_set_child.
gtk/gtkscrolledwindow.c | 2 +-
tests/scrolling-performance.c | 2 +-
tests/testgrid.c | 2 +-
tests/testscrolledwindow.c | 2 +-
tests/testscrolltofocus.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index d2c660607e..0d2eedccd7 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -3501,7 +3501,7 @@ gtk_scrolled_window_add (GtkContainer *container,
else
{
scrollable_child = gtk_viewport_new (hadj, vadj);
- gtk_container_add (GTK_CONTAINER (scrollable_child), child);
+ gtk_viewport_set_child (GTK_VIEWPORT (scrollable_child), child);
priv->auto_added_viewport = TRUE;
}
diff --git a/tests/scrolling-performance.c b/tests/scrolling-performance.c
index 65a1c03f18..c47e834fb7 100644
--- a/tests/scrolling-performance.c
+++ b/tests/scrolling-performance.c
@@ -138,7 +138,7 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (scrolled_window), viewport);
grid = gtk_grid_new ();
- gtk_container_add (GTK_CONTAINER (viewport), grid);
+ gtk_viewport_set_child (GTK_VIEWPORT (viewport), grid);
for (i = 0; i < 4; i++)
{
diff --git a/tests/testgrid.c b/tests/testgrid.c
index 6f05e7b66e..0df805101a 100644
--- a/tests/testgrid.c
+++ b/tests/testgrid.c
@@ -264,7 +264,7 @@ scrolling (void)
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), viewport);
- gtk_container_add (GTK_CONTAINER (viewport), grid);
+ gtk_viewport_set_child (GTK_VIEWPORT (viewport), grid);
child = oriented_test_widget ("#800080", "#800080");
gtk_grid_attach (GTK_GRID (grid), child, 0, 0, 1, 1);
diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c
index a03851f954..a8926410d3 100644
--- a/tests/testscrolledwindow.c
+++ b/tests/testscrolledwindow.c
@@ -118,7 +118,7 @@ scrollable_policy (void)
gtk_widget_show (label);
gtk_widget_show (viewport);
- gtk_container_add (GTK_CONTAINER (viewport), label);
+ gtk_viewport_set_child (GTK_VIEWPORT (viewport), label);
gtk_container_add (GTK_CONTAINER (swindow), viewport);
/* Add controls here */
diff --git a/tests/testscrolltofocus.c b/tests/testscrolltofocus.c
index ac46c815ce..8bc6da352f 100644
--- a/tests/testscrolltofocus.c
+++ b/tests/testscrolltofocus.c
@@ -21,7 +21,7 @@ int main (int argc, char *argv[])
gtk_widget_set_margin_end (grid, 20);
gtk_widget_set_margin_top (grid, 20);
gtk_widget_set_margin_bottom (grid, 20);
- gtk_container_add (GTK_CONTAINER (viewport), grid);
+ gtk_viewport_set_child (GTK_VIEWPORT (viewport), grid);
for (i = 0; i < 20; i++)
for (j = 0; j < 20; j++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]