N-MainLoop
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
Gnome::Glib::N-MainLoop
Description
The Gnome::Glib::N-MainLoop struct is an opaque data type representing the main event loop of a GLib or GTK+ application.
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
Class initialization
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
#-------------------------------------------------------------------------------
new-mainloop
Creates a new Gnome::Glib::N-MainLoop structure.
method new-mainloop ( N-Object $context, Bool() $is-running --> Gnome::Glib::MainLoop \)
$context; a Gnome::Glib::N-MainContext (if undefined, the default context will be used).
$is-running; set to
Trueto indicate that the loop is running. This is not very important since calling.run()will set this toTrueanyway..
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
Methods
#-------------------------------------------------------------------------------
get-context
Returns the Gnome::Glib::N-MainContext of $loop.
method get-context (--> N-Object )
Return value; the Gnome::Glib::N-MainContext of $loop.
#-------------------------------------------------------------------------------
is-running
Checks to see if the main loop is currently being run via .run().
method is-running (--> Bool )
Return value; True if the mainloop is currently being run..
#-------------------------------------------------------------------------------
quit
Stops a Gnome::Glib::N-MainLoop from running. Any calls to .run()
for the loop will return.
Note that sources that have already been dispatched when
.quit() is called will still be executed.
method quit ( )
#-------------------------------------------------------------------------------
ref
Increases the reference count on a Gnome::Glib::N-MainLoop object by one.
method ref (--> N-Object )
Return value; $loop.
#-------------------------------------------------------------------------------
run
Runs a main loop until .quit() is called on the loop.
If this is called for the thread of the loop's Gnome::Glib::N-MainContext,
it will process events from the loop, otherwise it will
simply wait.
method run ( )
#-------------------------------------------------------------------------------
unref
Decreases the reference count on a Gnome::Glib::N-MainLoop object by one. If the result is zero, free the loop and free all associated memory.
method unref ( )