be achieved in two ways:</p>

<ol>
    <li><p>Create a
<a href="https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#GMainLoop">main loop</a>
and run it when the application starts:</p>


<pre><code>   local GLib = require("lgi").GLib
   -- Set up the application, then do:
   local main_loop = GLib.MainLoop()
   main_loop:run()
   -- use main_loop:quit() to stop the main loop.
</code></pre></li>
    <li><p>Use more fine-grained control by running an iteration at a time from
the
<a href="htt