lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Mon, Feb 21, 2011 at 5:51 AM, Jeff Smith <spammealot1@live.co.uk> wrote:
Maybe I just need to implement this timer code without using SWIG ? 

I forwarded your email to one of our developers who wrote timer APIs for our C/GTK program that embeds Lua and received the following response:

>>>

unfortunately his approach is too complex for my limited knowlege.
I don't use SWIG (have no idea what that is :).
 
He seems to want to execute a Lua function when the timer expires. My approach is much simpler: in my case, when the timer expires, I execute an entire Lua script.
 
This makes my code so much simpler.
 
Perhaps you can suggest this approach to him.

<<<

So we have two APIs:

   int Nc_Timer_Create(int nSeconds, string strLuaScriptPath)

This command creates a script timer that will execute the identified Lua script at the interval specified in seconds using parameter nSeconds. The command returns the timer's ID number. 

    Nc_Timer_Destroy([int nTimerID])

Destroys all existing script timers unless optional parameter nTimerID is supplied and has an integer value greater than 0, in which case only the timer whose ID is identified will be destroyed.

Best regards,

Paul

-- 
NoteCase Pro
The Massively-Multiplatform Outliner
<http://notecasepro.com>