mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
lua api: add function setSelected() for lua menu handler, update to v1.84
This commit is contained in:
@@ -75,6 +75,7 @@ void CLuaInstMenu::MenuRegister(lua_State *L)
|
||||
{ "hide", CLuaInstMenu::MenuHide },
|
||||
{ "setActive", CLuaInstMenu::MenuSetActive },
|
||||
{ "setName", CLuaInstMenu::MenuSetName },
|
||||
{ "setSelected", CLuaInstMenu::MenuSetSelected },
|
||||
{ "__gc", CLuaInstMenu::MenuDelete },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
@@ -577,3 +578,15 @@ int CLuaInstMenu::MenuDelete(lua_State *L)
|
||||
delete D;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstMenu::MenuSetSelected(lua_State *L)
|
||||
{
|
||||
CLuaMenu *D = MenuCheck(L, 1);
|
||||
if (!D) return 0;
|
||||
lua_assert(lua_istable(L, 2));
|
||||
|
||||
lua_Integer preselected; tableLookup(L, "preselected", preselected);
|
||||
|
||||
D->m->setSelected(preselected);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user