diff options
Diffstat (limited to 'gi/overrides/Gdk.py')
-rw-r--r-- | gi/overrides/Gdk.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py index 9d0ba7d..95030f8 100644 --- a/gi/overrides/Gdk.py +++ b/gi/overrides/Gdk.py @@ -202,6 +202,17 @@ class Event(Gdk.Event): else: raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, name)) + def __setattr__(self, name, value): + real_event = getattr(self, '_UNION_MEMBERS').get(self.type) + if real_event: + setattr(getattr(self, real_event), name, value) + else: + Gdk.Event.__setattr__(self, name, value) + + def __repr__(self): + base_repr = Gdk.Event.__repr__(self).strip("><") + return "<%s type=%r>" % (base_repr, self.type) + Event = override(Event) __all__.append('Event') |