From 755ce7ffbe5ceb27a1c385cf7cbc647c83e35ba9 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 | 5 +++++ glib/demo/layers.c | 4 ++++ glib/demo/render.c | 4 ++++ glib/demo/selections.c | 4 ++++ test/gtk-test.cc | 5 +++++ 6 files changed, 26 insertions(+) diff --git a/glib/demo/find.c b/glib/demo/find.c index 664c597..85884f7 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_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 7) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 7 && GTK_MICRO_VERSION < 8)) gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), demo->darea); +#else + gtk_container_add(GTK_CONTAINER(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..980151f 100644 --- a/glib/demo/images.c +++ b/glib/demo/images.c @@ -95,8 +95,13 @@ pgd_image_view_new () (gpointer)swindow); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 7) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 7 && GTK_MICRO_VERSION < 8)) gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), darea); +#else + gtk_container_add(GTK_CONTAINER(swindow), darea); +#endif + gtk_widget_show (darea); return swindow; diff --git a/glib/demo/layers.c b/glib/demo/layers.c index 023da20..c22f726 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_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 7) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 7 && GTK_MICRO_VERSION < 8)) gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), demo->darea); +#else + gtk_container_add(GTK_CONTAINER(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..6ae67ec 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_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 7) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 7 && GTK_MICRO_VERSION < 8)) gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (demo->swindow), demo->darea); +#else + gtk_container_add(GTK_CONTAINER(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..55d8094 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_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 7) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 7 && GTK_MICRO_VERSION < 8)) gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (demo->swindow), demo->darea); +#else + gtk_container_add(GTK_CONTAINER(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..585e9d8 100644 --- a/test/gtk-test.cc +++ b/test/gtk-test.cc @@ -306,8 +306,13 @@ view_new (PopplerDocument *doc) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 7) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 7 && GTK_MICRO_VERSION < 8)) gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), view->drawing_area); +#else + gtk_container_add(GTK_CONTAINER(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