def _run_mainloop(): '''If user haven't create a window, this is the executed mainloop''' while True: try: pymt_evloop.run() stopTouchApp() break except BaseException, inst: # use exception manager first r = pymt_exception_manager.handle_exception(inst) if r == ExceptionManager.RAISE: stopTouchApp() raise else: pass
def mainloop(self): # don't known why, but pygame required a resize event # for opengl, before mainloop... window reinit ? self.dispatch_event('on_resize', *self.size) evloop = getEventLoop() while not evloop.quit: try: self._mainloop() if not pygame.display.get_active(): pygame.time.wait(100) except BaseException, inst: # use exception manager first r = pymt_exception_manager.handle_exception(inst) if r == ExceptionManager.RAISE: stopTouchApp() raise else: pass