diff options
author | C. Scott Ananian <cscott@cscott.net> | 2011-11-04 01:12:56 (GMT) |
---|---|---|
committer | C. Scott Ananian <cscott@cscott.net> | 2011-11-10 03:13:42 (GMT) |
commit | db1d1641ea50b991fdeec592b6f716f1e1903eb1 (patch) | |
tree | 33685ce264ebd2277d91d03517a4146e8a9cfcb6 | |
parent | a40a1f2dac83be585a07a6b1d74948f103828bf1 (diff) |
Add nice constructor for GTK3 Gdk.Rectangle.
-rw-r--r-- | util/gtkcompat.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 |