[pygobject] Update Gdk overrides to work with latest Gtk+ 3
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Update Gdk overrides to work with latest Gtk+ 3
- Date: Sat, 4 Dec 2010 10:57:01 +0000 (UTC)
commit 4d097eea94258eda0c328711491fd456cbd6741b
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Dec 4 11:57:02 2010 +0100
Update Gdk overrides to work with latest Gtk+ 3
For now added consitionals on version == 2.0, but maybe at some point we
shuld just clean up the old stuff.
gi/overrides/Gdk.py | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
index e98f060..c59685a 100644
--- a/gi/overrides/Gdk.py
+++ b/gi/overrides/Gdk.py
@@ -62,12 +62,20 @@ if Gdk.version == '2.0':
Rectangle = override(Rectangle)
__all__.append('Rectangle')
-class Drawable(Gdk.Drawable):
- def cairo_create(self):
- return Gdk.cairo_create(self)
+if Gdk.version == '2.0':
+ class Drawable(Gdk.Drawable):
+ def cairo_create(self):
+ return Gdk.cairo_create(self)
+
+ Drawable = override(Drawable)
+ __all__.append('Drawable')
+else:
+ class Window(Gdk.Window):
+ def cairo_create(self):
+ return Gdk.cairo_create(self)
-Drawable = override(Drawable)
-__all__.append('Drawable')
+ Window = override(Window)
+ __all__.append('Window')
class Event(Gdk.Event):
_UNION_MEMBERS = {
@@ -101,9 +109,11 @@ class Event(Gdk.Event):
Gdk.EventType.DROP_FINISHED: 'dnd',
Gdk.EventType.CLIENT_EVENT: 'client',
Gdk.EventType.VISIBILITY_NOTIFY: 'visibility',
- Gdk.EventType.NO_EXPOSE: 'no_expose'
}
+ if Gdk.version == '2.0':
+ _UNION_MEMBERS[Gdk.EventType.NO_EXPOSE] = 'no_expose'
+
def __new__(cls, *args, **kwargs):
return Gdk.Event.__new__(cls)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]