Basics
Guides
API Reference
Basics
Guides
API Reference
[13:7] extends: object
The GMainLoop struct is an opaque data type representing the main event
loop of a GLib or GTK application.
GMainLoop (context = null, is_running = null)
Creates a new [struct@GLib.MainLoop] structure.
context is a main context (if NULL, the global-default main context will be used)..is_running is set to true to indicate that the loop is running. This is not very important since calling [method@GLib.MainLoop.run] will set this to true anyway..toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.get_context ()
Returns the [struct@GLib.MainContext] of @loop.
the [struct@GLib.MainContext] of @loop.is_running ()
Checks to see if the main loop is currently being run via [method@GLib.MainLoop.run].
true if the main loop is currently being run, false otherwise.quit ()
Stops a [struct@GLib.MainLoop] from running. Any calls to [method@GLib.MainLoop.run] for the loop will return. Note that sources that have already been dispatched when [method@GLib.MainLoop.quit] is called will still be executed.
None.ref ()
Increases the reference count on a [struct@GLib.MainLoop] object by one.
@loop.run ()
Runs a main loop until [method@GLib.MainLoop.quit] is called on the loop. If this is called from the thread of the loop’s [struct@GLib.MainContext], it will process events from the loop, otherwise it will simply wait.
None.unref ()
Decreases the reference count on a [struct@GLib.MainLoop] object by one. If the result is zero, the loop and all associated memory are freed.
None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.