Original Post
I am currently working on a project to drive a user interface system through Lua and XML. Currently, to do something like making a window visible, I do the following in lua: WindowSetShowing( 'LoginWindow', true ) Where WindowSetShowing( lua_state *pState ) is an exposed C function that parses the 'window name' and the 'showing state' parameters. What I would like to do instead is this: LoginWindow.SetShowing( true) Where Instead of providing 'LoginWindow' as a parameter, SetShowing() is a psudo 'member function' of 'LoginWindow'. In C, I'd like to examine the name of the table from which the function was called to determine the window name. The problem with this is that when entering an exposed C function, the top of the lua stack is equal to the number of parameters being sent to the function. Not the current stack height. So, there is no obvious way for me to get at the lua_stack. Does this mean the lua stack is only used for interaction with c, and not internal lua processing? Any suggestions?