hw_RunTimerCallback -- run timer user callback (V6.0)
int error = hw_RunTimerCallback(lua_State *L, APTR handle);
This function runs the user callback associated with the specified timer handle that has been allocated by RegisterTimer(). The user callback can be a function that has been installed either using Hollywood's SetInterval() or SetTimeout() command.

You will normally call hw_RunTimerCallback() whenever your timer has fired. However, you need to take care that you call this function at a reasonable time. hw_RunTimerCallback() will immediately call lua_pcall() so it must be called at a time when the Hollywood script expects to be interrupted by a user callback, preferably while it is in a WaitEvent() state. Thus, it is advised that you call this function somewhere in your HandleEvents() implementation. When in HandleEvents() make sure to check that the HWHEFLAGS_LINEHOOK and HWHEFLAGS_MODAL flags aren't set. Then you can be sure that HandleEvents() has been called in response to the WaitEvent() or CheckEvent() Hollywood commands and you may safely call hw_RunTimerCallback().

Designer compatibility

pointer to the lua_State
timer handle allocated by RegisterTimer()
error code or 0 for success

Show TOC