Event loop management

kivy.base.EventLoop

EventLoop instance

kivy.base.ExceptionManager

Kivy Exception Manager instance

class kivy.base.ExceptionHandler

Base handler that catch exception in runTouchApp(). You can derivate and use it like this

class E(ExceptionHandler):
    def handle_exception(self, inst):
        Logger.exception(inst)
        return ExceptionManager.PASS

ExceptionManager.add_handler(E())

All exceptions will be set to PASS, and logged to console !

handle_exception(exception)

Handle one exception, default return ExceptionManager.STOP

kivy.base.runTouchApp(widget=None, slave=False)

Static main function that starts the application loop. You got some magic things, if you are using argument like this :

Parameters :
<empty>

To make dispatching work, you need at least one input listener. If not, application will leave. (MTWindow act as an input listener)

widget

If you pass only a widget, a MTWindow will be created, and your widget will be added on the window as the root widget.

slave

No event dispatching are done. This will be your job.

widget + slave

No event dispatching are done. This will be your job, but we are trying to get the window (must be created by you before), and add the widget on it. Very usefull for embedding Kivy in another toolkit. (like Qt, check kivy-designed)

kivy.base.stopTouchApp()

Stop the current application by leaving the main loop