CallbackQuitEvents

See in particular the example/callback_functions.py