X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/blobdiff_plain/21cc59e0782f77420330a2b108c6708ea2edade0..d44cf918237d05fa9e0eec3f61dce8cbb8d98151:/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