1.15 <GMainLoop>

Structure: <GMainLoop>

The <GMainLoop> struct is an opaque data type representing the main event loop of a GLib or GTK application.

Procedures

Method: main-loop:get-context self ⇒ %return
Method: get-context self ⇒ %return

Returns the <GMainContext> of self.

self

Passed: a <GMainLoop>.

a main loop

%return

Returned: a <GMainContext>.

the <GMainContext> of self

Method: main-loop:is-running? self ⇒ %return
Method: is-running? self ⇒ %return

Checks to see if the main loop is currently being run via main-loop:run.

self

Passed: a <GMainLoop>.

a main loop

%return

Returned: a boolean.

true if the main loop is currently being run, false otherwise

Procedure: main-loop:new context is-running ⇒ %return

Creates a new <GMainLoop> structure.

context

Passed: a <GMainContext>, or #f.

a main context (if NULL, the global-default main context will be used).

is-running

Passed: a boolean.

set to true to indicate that the loop is running. This is not very important since calling main-loop:run will set this to true anyway.

%return

Returned: a <GMainLoop>.

a new main loop

Method: main-loop:quit self
Method: quit self

Stops a <GMainLoop> from running. Any calls to main-loop:run for the loop will return.

Note that sources that have already been dispatched when main-loop:quit is called will still be executed.

self

Passed: a <GMainLoop>.

a main loop

Method: main-loop:ref self ⇒ %return
Method: ref self ⇒ %return

Increases the reference count on a <GMainLoop> object by one.

self

Passed: a <GMainLoop>.

a main loop

%return

Returned: a <GMainLoop>.

self

Method: main-loop:run self
Method: run self

Runs a main loop until main-loop:quit is called on the loop.

If this is called from the thread of the loop’s <GMainContext>, it will process events from the loop, otherwise it will simply wait.

self

Passed: a <GMainLoop>.

a main loop

Method: main-loop:unref self
Method: unref self

Decreases the reference count on a <GMainLoop> object by one.

If the result is zero, the loop and all associated memory are freed.

self

Passed: a <GMainLoop>.

a main loop