ON_COLUMN_OVERSIZING = 1.5
-def rename_method(newName) :
+def event_handler(eventType) :
def doRename(m) :
- m.__name__ = newName
+ m.__name__ = 'eventHandler%s' % eventType
return m
return doRename
handler = getattr(self, 'eventHandler%s' % event.type, lambda e:None)
handler(event)
- @rename_method('eventHandler%s' % pygame.KEYDOWN)
+ @event_handler(pygame.KEYDOWN)
def handleKeyDown(self, event) :
if event.key == pygame.K_q:
self._running = False
if uni.isdigit() and int(uni) <=8 :
self.highlightColumn(int(uni))
+
+ @event_handler(pygame.MOUSEMOTION)
+ def handleMouseMotion(self, event) :