lua-users home
lua-l archive

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


At 18:06 13/02/2003 -0500, you wrote:
Thanks Wim.

I'm not exporting a C function; I'm using tolua to wrap the Schedule function in my TimerManager class. I guess that means I can't use lua_ref() to pop from the stack. Does this mean there's no specific type that can be used to tell tolua to
pass a table as a parameter?

We have a similar situation with the scripts that control the GUI on our game (we need to connect lua functions to sigc++ signals). What we did is just use our own connector function (the equivalent to your 'Timer:Schedule()'), and registered it ourselves on the luastate using functions from the tolua library. You can take the table reference there.. It's really easy, they have a 'tolua_function()' to register, and tolua_popnumber and popstring to handle the stack. Just take a look at some of the code that tolua generates.

bye..

Ariel.