Package: gdk

Function gdk-threads-add-timeout

Lambda List

gdk-threads-add-timeout (interval func &key priority)

Arguments

interval -- an unsigned integer with the time between calls to the function, in milliseconds (1/1000ths of a second)
func -- a g-source-func callback function to call
priority -- an integer with the priority of the timeout source, typically this will be in the range between +g-priority-default-idle+ and +g-priority-high-idle+

Return Value

An unsigned integer ID, greater than 0, of the event source.

Details

Sets a function to be called at regular intervals holding the GDK lock, with the given priority. The default priority is +g-priority-default+. The function is called repeatedly until it returns false, at which point the timeout is automatically destroyed and the function will not be called again.

Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval It does not try to 'catch up' time lost in delays.

This variant of the g-timeout-add function can be thought of a MT-safe version for GTK widgets.
 

See also

2021-12-13