From db1d1641ea50b991fdeec592b6f716f1e1903eb1 Mon Sep 17 00:00:00 2001 From: C. Scott Ananian Date: Fri, 04 Nov 2011 01:12:56 +0000 Subject: Add nice constructor for GTK3 Gdk.Rectangle. --- diff --git a/util/gtkcompat.py b/util/gtkcompat.py index 6e2bb67..fea0b6f 100644 --- a/util/gtkcompat.py +++ b/util/gtkcompat.py @@ -8,7 +8,11 @@ try: gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GObject, GdkPixbuf from gi.repository import Pango, PangoCairo - Rectangle = lambda x, y, w, h: (x,y,w,h) + def Rectangle(x, y, w, h): + r = Gdk.Rectangle() + r.x, r.y = x, y + r.width, r.height = w, h + return r GObject.TYPE_NONE = None # compatibility hack class GConf: pass # XXX no more GConf, sigh -- cgit v0.9.1