[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaPlus: Functor Arguments
- From: Joshua Jensen <jjensen@...>
- Date: Fri, 28 Oct 2005 21:57:42 -0600
Katherine Scott wrote:
I am new to Lua/LuaPlus so this question may not be that
difficult. I am trying to develop a scriptable GUI system using
LuaPlus. My general plan of attack is to have a main "guiManager" that
receives commands from lua via object dispatch functors. The
guiManager's functors are being called, but it seems that I can't get
the function arguments from the lua stack. Are there any differences
for getting function arguments for functors versus directly registered
Remember that the 'self' object comes in as the first parameter.
Therefore, you have to access args to get to the string.
int CLuaGooeyManager::createNewContext( LuaState * luaState )
LuaStack args(luaState); // grab the stack
if( args.IsString() ) // !!! THIS TEST FAILS - THROWS ERROR
name = args.GetString( ); // get the name
As an FYI, luaState.Get()-> is better put as luaState->
Your code is pretty much correct. Are you using the latest build of
LuaPlus out of Subversion?