[dia] [gtk-deprecated] protect gtk_widget_get_allocated_width ()
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [gtk-deprecated] protect gtk_widget_get_allocated_width ()
- Date: Sun, 19 Aug 2012 17:39:01 +0000 (UTC)
commit 972272a01b3b3cdad4445ea98d701bc426bd294a
Author: Hans Breuer <hans breuer org>
Date: Sun Aug 19 19:21:18 2012 +0200
[gtk-deprecated] protect gtk_widget_get_allocated_width ()
Dia master is still supposed to compile with gtk-2-16
app/ruler.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/app/ruler.c b/app/ruler.c
index 5b0c25d..dc49a1f 100644
--- a/app/ruler.c
+++ b/app/ruler.c
@@ -72,8 +72,13 @@ dia_ruler_draw (GtkWidget *widget,
layout = gtk_widget_create_pango_layout (widget, "012456789");
+#if GTK_CHECK_VERSION(3,0,0)
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
+#else
+ width = widget->allocation.width;
+ height = widget->allocation.height;
+#endif
dx = (ruler->orientation == GTK_ORIENTATION_VERTICAL) ? width/3 : 0;
dy = (ruler->orientation == GTK_ORIENTATION_HORIZONTAL) ? height/3 : 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]