From 327ca88ca8840382e9c943760e3ec7d16734205f Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Tue, 15 Nov 2011 23:58:54 +0100 Subject: [PATCH] Adapt to Widget.get_child_requisition() API changes In PyGTK Widget.get_child_requisition() returned a tuple [1]. In GTK3+pygi a Requisition object is returned instead. Based on a patch by Benjamin Berg . [1] http://developer.gnome.org/pygtk/stable/class-gtkwidget.html#method-gtkwidget--get-child-requisition [2] http://developer.gnome.org/gtk/stable/GtkWidget.html#gtk-widget-get-child-requisition Signed-off-by: Sascha Silbe --- src/sugar3/graphics/icon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py index 04c1e894..01ed7cfe 100644 --- a/src/sugar3/graphics/icon.py +++ b/src/sugar3/graphics/icon.py @@ -409,9 +409,9 @@ class Icon(Gtk.Image): allocation = self.get_allocation() x = math.floor(allocation.x + xpad + - (allocation.width - requisition[0]) * xalign) + (allocation.width - requisition.width) * xalign) y = math.floor(allocation.y + ypad + - (allocation.height - requisition[1]) * yalign) + (allocation.height - requisition.height) * yalign) cr = self.get_window().cairo_create()