Class MainLoop

All Implemented Interfaces:
PointerInterface

public class MainLoop extends Record
The `GMainLoop` struct is an opaque data type
representing the main event loop of a GLib or GTK+ application.

https://docs.gtk.org/glib/struct.MainLoop.html

  • Constructor Details

    • MainLoop

      public MainLoop(PointerContainer pointer)
    • MainLoop

      public MainLoop(@Nullable MainContext context, boolean is_running)
      Creates a new #GMainLoop structure.
      Parameters:
      context - a #GMainContext (if %NULL, the default context will be used).
      is_running - set to %TRUE to indicate that the loop is running. This is not very important since calling g_main_loop_run() will set this to %TRUE anyway.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getContext

      public MainContext getContext()
      Returns the #GMainContext of @loop.
      Returns:
      the #GMainContext of @loop
    • isRunning

      public boolean isRunning()
      Checks to see if the main loop is currently being run via g_main_loop_run().
      Returns:
      %TRUE if the mainloop is currently being run.
    • quit

      public void quit()
      Stops a #GMainLoop from running. Any calls to g_main_loop_run()
      for the loop will return.

      Note that sources that have already been dispatched when
      g_main_loop_quit() is called will still be executed.
    • ref

      public MainLoop ref()
      Increases the reference count on a #GMainLoop object by one.
      Returns:
      @loop
    • run

      public void run()
      Runs a main loop until g_main_loop_quit() is called on the loop.
      If this is called for the thread of the loop's #GMainContext,
      it will process events from the loop, otherwise it will
      simply wait.
    • unref

      public void unref()
      Decreases the reference count on a #GMainLoop object by one. If
      the result is zero, free the loop and free all associated memory.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()