add


Description:

[ Version ( since = "0.4" ) ]
public uint add (uint fps, owned SourceFunc func)

Sets a function to be called at regular intervals, and puts it inside the this.

Note:

There is no direct replacement for this API

The function is repeatedly called until it returns false, at which point the timeout is automatically destroyed and the function won't be called again. If notify is not null, the notify function will be called. The first call to func will be at the end of interval.

Since Clutter 0.8 this will try to compensate for delays. For example, if func takes half the interval time to execute then the function will be called again half the interval time after it finished. Before version 0.8 it would not fire until a full interval after the function completes so the delay between calls would be interval * 1.5. This function does not however try to invoke the function multiple times to catch up missing frames if func takes more than interval ms to execute.

Parameters:

this

a TimeoutPool

fps

the time between calls to the function, in frames per second

func

function to call

data

data to pass to the function, or null

notify

function to call when the timeout is removed, or null

Returns:

the ID (greater than 0) of the timeout inside the pool. Use remove to stop the timeout.