Runs the main loop once (e.g. updates the GUI) and blocks until an event is pending.
This is useful during long-running functions which block the whole application. Have a look at the example at events_pending.