summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2013-11-13 18:07:42 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2013-11-13 18:07:42 +0100
commit91522bd0b3cff351252ebbdbd23e1a2a02688394 (patch)
treeae40cc0899b993be1265957ba60ee55252ae0143 /examples
parentb570b6fa9e85fd2d0881fb9ddb2b2e4d47156748 (diff)
downloadlibrcc-91522bd0b3cff351252ebbdbd23e1a2a02688394.tar.gz
librcc-91522bd0b3cff351252ebbdbd23e1a2a02688394.tar.bz2
librcc-91522bd0b3cff351252ebbdbd23e1a2a02688394.tar.xz
librcc-91522bd0b3cff351252ebbdbd23e1a2a02688394.zip
Fix GTK3 deprecated functions...
Diffstat (limited to 'examples')
-rw-r--r--examples/rcc-gtk-config.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/examples/rcc-gtk-config.c b/examples/rcc-gtk-config.c
index 41c4a5c..aa5359c 100644
--- a/examples/rcc-gtk-config.c
+++ b/examples/rcc-gtk-config.c
@@ -115,10 +115,20 @@ int main (int argc, char *argv[])
box = rccUiGetPage(uictx, NULL);
gtk_widget_show (box);
-// gtk_container_add (GTK_CONTAINER (window1), box);
+
+#if ((GTK_MAJOR_VERSION < 3) || (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(scroll), box);
+#else
+ gtk_container_add (GTK_CONTAINER (scroll), box);
+#endif
+#if GTK_MAJOR_VERSION > 2
+ hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_set_homogeneous(GTK_BOX(hbox), TRUE);
+#else /* GTK_MAJOR_VERSION < 3 */
hbox = gtk_hbox_new (TRUE, 0);
+#endif /* GTK_MAJOR_VERSION */
+
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0);
@@ -142,7 +152,11 @@ int main (int argc, char *argv[])
#endif /* GTK_MAJOR_VERSION */
gtk_box_pack_start (GTK_BOX (hbox), save, FALSE, FALSE, 0);
+#if GTK_MAJOR_VERSION > 2
+ gtk_widget_get_preferred_size (box, NULL, &size);
+#else /* GTK_MAJOR_VERSION < 3 */
gtk_widget_size_request(box, &size);
+#endif /* GTK_MAJOR_VERSION */
hints.min_width = size.width;
hints.min_height = size.height;