X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/5fd262589f4c98f0f37c7b9806c12446fd1f8e92..975ed3f44e237886978f0063f2907baa8eaf46c1:/src/minwii/widgets/instrumentselector.py?ds=sidebyside diff --git a/src/minwii/widgets/instrumentselector.py b/src/minwii/widgets/instrumentselector.py index 52799d0..f8a5e32 100755 --- a/src/minwii/widgets/instrumentselector.py +++ b/src/minwii/widgets/instrumentselector.py @@ -60,10 +60,14 @@ class InstrumentSelector(pygame.sprite.LayeredDirty, EventHandlerMixin) : pygame.display.flip() pygame.mouse.set_visible(False) while self._running : - EventDispatcher.dispatchEvents() - dirty = self.draw(pygame.display.get_surface()) - pygame.display.update(dirty) - clock.tick(FRAMERATE) + try : + EventDispatcher.dispatchEvents() + dirty = self.draw(pygame.display.get_surface()) + pygame.display.update(dirty) + clock.tick(FRAMERATE) + except KeyboardInterrupt : + self.stop() + raise def stop(self) : self._running = False