Package org.gnome.glib
Class MainLoop
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.glib.MainLoop
- All Implemented Interfaces:
Proxy
The
GMainLoop struct is an opaque data type
representing the main event loop of a GLib or GTK application.-
Constructor Summary
ConstructorsConstructorDescriptionMainLoop(MemorySegment address) Create a MainLoop proxy instance for the provided memory address.MainLoop(@Nullable MainContext context, boolean isRunning) Creates a newGLib.MainLoopstructure. -
Method Summary
Modifier and TypeMethodDescriptionReturns theGLib.MainContextofloop.static @Nullable TypegetType()Get the GType of the MainLoop classbooleanChecks to see if the main loop is currently being run viarun().voidquit()Stops aGLib.MainLoopfrom running.ref()Increases the reference count on aGLib.MainLoopobject by one.voidrun()Runs a main loop untilquit()is called on the loop.voidunref()Decreases the reference count on aGLib.MainLoopobject by one.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
MainLoop
Create a MainLoop proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
MainLoop
Creates a newGLib.MainLoopstructure.- Parameters:
context- a main context (ifNULL, the global-default main context will be used).isRunning- set to true to indicate that the loop is running. This is not very important since callingrun()will set this to true anyway.
-
-
Method Details
-
getType
-
getContext
Returns theGLib.MainContextofloop.- Returns:
- the
GLib.MainContextof this MainLoop
-
isRunning
public boolean isRunning()Checks to see if the main loop is currently being run viarun().- Returns:
- true if the main loop is currently being run, false otherwise
-
quit
-
ref
Increases the reference count on aGLib.MainLoopobject by one.- Returns:
- this MainLoop
-
run
public void run()Runs a main loop untilquit()is called on the loop.If this is called from the thread of the loop’s
GLib.MainContext, it will process events from the loop, otherwise it will simply wait. -
unref
public void unref()Decreases the reference count on aGLib.MainLoopobject by one.If the result is zero, the loop and all associated memory are freed.
-