GLib.MainLoop¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GLib.MainLoop(context=None)¶
The
GMainLoop
struct is an opaque data type representing the main event loop of a GLib or GTK application.- classmethod new(context, is_running)[source]¶
- Parameters:
context (
GLib.MainContext
orNone
) – aGLib.MainContext
(ifNone
, the global-default main context will be used).is_running (
bool
) – set toTrue
to indicate that the loop is running. This is not very important since calling [method`GLib`.MainLoop.run] will set this toTrue
anyway.
- Returns:
a new
GLib.MainLoop
.- Return type:
Creates a new [struct`GLib`.MainLoop] structure.
- get_context()[source]¶
- Returns:
the [struct`GLib`.MainContext] of self
- Return type:
Returns the [struct`GLib`.MainContext] of self.
- is_running()[source]¶
-
Checks to see if the main loop is currently being run via [method`GLib`.MainLoop.run].
- quit()[source]¶
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.
- ref()[source]¶
- Returns:
self
- Return type:
Increases the reference count on a [struct`GLib`.MainLoop] object by one.
- run()[source]¶
Runs a main loop until [method`GLib`.MainLoop.quit] is called on the loop. If this is called for the thread of the loop’s
GLib.MainContext
, it will process events from the loop, otherwise it will simply wait.