diff options
Diffstat (limited to 'iup/srclua5/iuplua_api.c')
-rwxr-xr-x | iup/srclua5/iuplua_api.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/iup/srclua5/iuplua_api.c b/iup/srclua5/iuplua_api.c index 8673442..adf5383 100755 --- a/iup/srclua5/iuplua_api.c +++ b/iup/srclua5/iuplua_api.c @@ -99,7 +99,7 @@ static int GetAttribute (lua_State *L) Ihandle *ih = iuplua_checkihandle(L,1); const char *name = luaL_checkstring(L,2); const char *value = IupGetAttribute(ih, name); - if (!value || iupAttribIsInternal(name)) + if (!value || iupATTRIB_ISINTERNAL(name)) lua_pushnil(L); else { @@ -313,6 +313,12 @@ static int LoopStep(lua_State *L) return 1; } +static int LoopStepWait(lua_State *L) +{ + lua_pushnumber(L,IupLoopStepWait()); + return 1; +} + static int ExitLoop(lua_State *L) { (void)L; @@ -774,7 +780,7 @@ static int UnMapFont (lua_State *L) ****************************************************************************/ -int iupluaapi_open(lua_State * L) +void iupluaapi_open(lua_State * L) { struct luaL_reg funcs[] = { {"Append", Append}, @@ -806,6 +812,7 @@ int iupluaapi_open(lua_State * L) {"Load", Load}, {"LoadBuffer", LoadBuffer}, {"LoopStep", LoopStep}, + {"LoopStepWait", LoopStepWait}, {"ExitLoop", ExitLoop}, {"MainLoop", MainLoop}, {"MainLoopLevel", MainLoopLevel}, @@ -867,8 +874,6 @@ int iupluaapi_open(lua_State * L) {NULL, NULL}, }; - /* Registers functions in iup namespace */ - luaL_openlib(L, NULL, funcs, 0); - - return 0; /* nothing in stack */ + /* "iup" table is at the top of the stack */ + luaL_register(L, NULL, funcs); } |