+ def _initCursor(self) :
+ self.cursor = WarpingCursor()
+ self.add(self.cursor)
+
+
+ def highlightColumn(self, index) :
+ for i, sprite in enumerate(self.sprites()) :
+ sprite.update(i==index)
+ self.draw(pygame.display.get_surface())
+
+ def run(self):
+ self._running = True
+ clock = pygame.time.Clock()
+ pygame.display.flip()
+ while self._running :
+ EventDispatcher.dispatchEvents()
+ dirty = self.draw(pygame.display.get_surface())
+ pygame.display.update(dirty)
+ clock.tick(50)
+
+ @event_handler(pygame.KEYDOWN)
+ def handleKeyDown(self, event) :
+ if event.key == pygame.K_q:
+ self._running = False
+ uni = event.unicode
+
+ if uni.isdigit() and int(uni) <=8 :
+ self.highlightColumn(int(uni))