GLib.MainLoop¶
Fields¶
None
Methods¶
| class | new(context, is_running) | 
| get_context() | |
| is_running() | |
| quit() | |
| ref() | |
| run() | |
| unref() | 
Details¶
- 
class GLib.MainLoop(context=None)¶
- The - GMainLoopstruct 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.MainContextorNone) – aGLib.MainContext(ifNone, the default context will be used).
- is_running (bool) – set toTrueto indicate that the loop is running. This is not very important since callingGLib.MainLoop.run() will set this toTrueanyway.
 - Returns: - a new - GLib.MainLoop.- Return type: - Creates a new - GLib.MainLoopstructure.
- context (
 - 
get_context()[source]¶
- Returns: - the - GLib.MainContextof self- Return type: - GLib.MainContext- Returns the - GLib.MainContextof self.
 - 
is_running()[source]¶
- Returns: - Trueif the mainloop is currently being run.- Return type: - bool- Checks to see if the main loop is currently being run via - GLib.MainLoop.run().
 - 
quit()[source]¶
- Stops a - GLib.MainLoopfrom running. Any calls to- GLib.MainLoop.run() for the loop will return.- Note that sources that have already been dispatched when - GLib.MainLoop.quit() is called will still be executed.
 - 
ref()[source]¶
- Returns: - self - Return type: - GLib.MainLoop- Increases the reference count on a - GLib.MainLoopobject by one.
 - 
run()[source]¶
- Runs a main loop until - 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.
 - 
unref()[source]¶
- Decreases the reference count on a - GLib.MainLoopobject by one. If the result is zero, free the loop and free all associated memory.
 
- 
classmethod