GLib.MainContext.iteration

### Method

# GLib MainContextiteration

#### Declaration [src]

    gboolean
    g_main_context_iteration (
      GMainContext* context,
      gboolean may_block
    )

#### Description [src]

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` is true, waiting for a source to become ready, then dispatching the highest priority events sources that are ready. Otherwise, if `may_block` is false, this function does not wait for sources to become ready, and only the highest priority sources which are already ready (if any) will be dispatched.

Note that even when `may_block` is true, it is still possible for `g_main_context_iteration()` to return false, since the wait may be interrupted for other reasons than an event source becoming ready.

#### Parameters

`context`

  Type: `GMainContext`

  A main context (if `NULL`, the global-default main context will be used).

  The argument can be `NULL`.

`may_block`

  Type: `gboolean`

  Whether the call may block.

#### Return value

Type: `gboolean`

True if events were dispatched, false otherwise.