GLib.MainLoop¶
record (struct)
The GMainLoop struct is an opaque data type
representing the main event loop of a GLib or GTK application.
Constructors¶
new¶
Creates a new MainLoop structure.
Parameters:
context— a main context (ifNULL, the global-default main context will be used).is_running— set to true to indicate that the loop is running. This is not very important since callingMainLoop.runwill set this to true anyway.
Methods¶
get_context¶
Returns the MainContext of loop.
is_running¶
Checks to see if the main loop is currently being run via
MainLoop.run.
quit¶
Stops a MainLoop from running. Any calls to
MainLoop.run for the loop will return.
Note that sources that have already been dispatched when
MainLoop.quit is called will still be executed.
ref¶
Increases the reference count on a MainLoop object by one.
run¶
Runs a main loop until MainLoop.quit is called on the loop.
If this is called from the thread of the loop’s MainContext,
it will process events from the loop, otherwise it will
simply wait.
unref¶
Decreases the reference count on a MainLoop object by one.
If the result is zero, the loop and all associated memory are freed.