MainContext#
- class MainContext(**kwargs)#
The GMainContext
struct is an opaque data
type representing a set of sources to be handled in a main loop.
Methods#
- class MainContext
- iteration(may_block=True)#
Runs a single iteration for the given main loop. This involves checking to see if any event sources are ready to be processed, then if no events sources are ready and
may_block
isTrue
, waiting for a source to become ready, then dispatching the highest priority events sources that are ready. Otherwise, ifmay_block
isFalse
sources are not waited to become ready, only those highest priority events sources will be dispatched (if any), that are ready at this given moment without further waiting.Note that even when
may_block
isTrue
, it is still possible foriteration
to returnFalse
, since the wait may be interrupted for other reasons than an event source becoming ready.- Parameters:
may_block – whether the call may block.