Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GMainLoop

[13:7] extends: object

The GMainLoop struct is an opaque data type representing the main event loop of a GLib or GTK application.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GMainLoop (context = null, is_running = null)

    Creates a new [struct@GLib.MainLoop] structure.

    • @p context is a main context (if NULL, the global-default main context will be used)..
    • @p 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • get_context ()

    Returns the [struct@GLib.MainContext] of @loop.

    • @r the [struct@GLib.MainContext] of @loop.
  • is_running ()

    Checks to see if the main loop is currently being run via [method@GLib.MainLoop.run].

    • @r 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.

    • @r None.
  • ref ()

    Increases the reference count on a [struct@GLib.MainLoop] object by one.

    • @r @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.

    • @r 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.

    • @r None.