Checks if any events are pending in the event queue. This can be used to update the GUI and invoke timeouts etc. while doing some time intensive computation.
See main_iteration() .