<h1>Running the Main Loop</h1>

<verbatim>
  (current-main-loop-level) => INTEGER
</verbatim>
Determines the nesting level of currently running main loops.

<verbatim>
  (main-loop [YIELD-INTERVAL] [TIMEOUT]) => BOOLEAN
</verbatim>
Enters the Gtk+ main loop. Other CHICKEN threads are allowed to run at least every <tt>YIELD-INTERVAL</tt> seconds (default <tt>0.5</tt>).

The main loop is terminated automatically if no more top level windows are open.

The <tt>TIMEOUT</tt> can be <tt>#f</tt> (the default), a number of seconds or a SRFI-18 time object. When the timeout is reached, the main loop terminates and returns <tt>#f</tt>. Otherwise the procedure always returns <tt>#t</tt>.

<verbatim>
  (main-loop-quit!) => VOID
</verbatim>
Causes the innermost running Gtk+ event loop to terminate.