From f05c4392792cd722d0232d7556cbfa37640ea0f0 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Thu, 16 May 2013 21:06:56 +0200 Subject: [PATCH] Do not use deprecated gtk_scrolled_window_add_with_viewport() https://bugs.freedesktop.org/show_bug.cgi?id=64683 --- glib/demo/find.c | 4 ++++ glib/demo/images.c | 4 ++++ glib/demo/layers.c | 4 ++++ glib/demo/render.c | 4 ++++ glib/demo/selections.c | 4 ++++ test/gtk-test.cc | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/glib/demo/find.c b/glib/demo/find.c index 664c597..8e91952 100644 --- a/glib/demo/find.c +++ b/glib/demo/find.c @@ -507,7 +507,11 @@ pgd_find_create_widget (PopplerDocument *document) demo); swindow = gtk_scrolled_window_new (NULL, NULL); +#if GTK_CHECK_VERSION(3, 7, 8) + gtk_container_add(GTK_CONTAINER(swindow), demo->darea); +#else gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), demo->darea); +#endif gtk_widget_show (demo->darea); gtk_paned_add2 (GTK_PANED (hpaned), swindow); diff --git a/glib/demo/images.c b/glib/demo/images.c index 3623fd7..7057f9c 100644 --- a/glib/demo/images.c +++ b/glib/demo/images.c @@ -95,8 +95,12 @@ pgd_image_view_new () (gpointer)swindow); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#if GTK_CHECK_VERSION(3, 7, 8) + gtk_container_add(GTK_CONTAINER(swindow), darea); +#else gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), darea); +#endif gtk_widget_show (darea); return swindow; diff --git a/glib/demo/layers.c b/glib/demo/layers.c index 023da20..7931d21 100644 --- a/glib/demo/layers.c +++ b/glib/demo/layers.c @@ -265,7 +265,11 @@ pgd_layers_create_viewer (PgdLayersDemo *demo) swindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#if GTK_CHECK_VERSION(3, 7, 8) + gtk_container_add(GTK_CONTAINER(swindow), demo->darea); +#else gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), demo->darea); +#endif gtk_widget_show (demo->darea); gtk_box_pack_start (GTK_BOX (vbox), swindow, TRUE, TRUE, 0); diff --git a/glib/demo/render.c b/glib/demo/render.c index 354b862..52f96ff 100644 --- a/glib/demo/render.c +++ b/glib/demo/render.c @@ -427,8 +427,12 @@ pgd_render_create_widget (PopplerDocument *document) demo->swindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (demo->swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#if GTK_CHECK_VERSION(3, 7, 8) + gtk_container_add(GTK_CONTAINER(demo->swindow), demo->darea); +#else gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (demo->swindow), demo->darea); +#endif gtk_widget_show (demo->darea); gtk_box_pack_start (GTK_BOX (vbox), demo->swindow, TRUE, TRUE, 0); diff --git a/glib/demo/selections.c b/glib/demo/selections.c index 7ff17cd..567a880 100644 --- a/glib/demo/selections.c +++ b/glib/demo/selections.c @@ -671,8 +671,12 @@ pgd_selections_create_widget (PopplerDocument *document) demo->swindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (demo->swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#if GTK_CHECK_VERSION(3, 7, 8) + gtk_container_add(GTK_CONTAINER(demo->swindow), demo->darea); +#else gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (demo->swindow), demo->darea); +#endif gtk_widget_show (demo->darea); gtk_box_pack_start (GTK_BOX (vbox), demo->swindow, TRUE, TRUE, 0); diff --git a/test/gtk-test.cc b/test/gtk-test.cc index 6deb401..aab7951 100644 --- a/test/gtk-test.cc +++ b/test/gtk-test.cc @@ -306,8 +306,12 @@ view_new (PopplerDocument *doc) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#if GTK_CHECK_VERSION(3, 7, 8) + gtk_container_add(GTK_CONTAINER(sw), view->drawing_area); +#else gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), view->drawing_area); +#endif gtk_widget_show (view->drawing_area); gtk_box_pack_end (GTK_BOX (vbox), sw, TRUE, TRUE, 0); -- 1.8.1.2