capi.widget: draw only widgets with numeric index

Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Lukas Hrazky 2009-10-24 15:04:31 +02:00 committed by Julien Danjou
parent a7c5668a92
commit ec33544896
1 changed files with 11 additions and 4 deletions

View File

@ -107,11 +107,18 @@ luaA_table2widgets(lua_State *L, widget_node_array_t *widgets)
{ {
if(lua_istable(L, -1)) if(lua_istable(L, -1))
{ {
lua_pushnil(L); int i = 1;
while(luaA_next(L, -2)) lua_pushnumber(L, i++);
lua_gettable(L, -2);
while(!lua_isnil(L, -1))
{
luaA_table2widgets(L, widgets); luaA_table2widgets(L, widgets);
/* remove the table */ lua_pushnumber(L, i++);
lua_pop(L, 1); lua_gettable(L, -2);
}
/* remove the nil and the table */
lua_pop(L, 2);
} }
else else
{ {