Package: glib

Function g-idle-add

Lambda List

g-idle-add (func &key priority)

Arguments

func -- a g-source-func callback function to call
priority -- an integer with the priority of the idle source, typically this will be in the range between +g-priority-default-idle+ and +g-priority-high-idle+

Return Value

The unsigned integer ID greater than 0 of the event source.

Details

Adds a function to be called whenever there are no higher priority events pending to the default main loop. The priority keyword argument has the +g-priority-default-idle+ default value. If the function returns false it is automatically removed from the list of event sources and will not be called again.

This internally creates a main loop source using the g-idle-source-new function and attaches it to the main loop context using the g-source-attach function. You can do these steps manually if you need greater control.
 

See also

2021-12-10