statusbar: widget_get() returns a dict
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
bdd6b078f2
commit
06b490d319
11
statusbar.c
11
statusbar.c
|
@ -520,17 +520,16 @@ static int
|
||||||
luaA_statusbar_widget_get(lua_State *L)
|
luaA_statusbar_widget_get(lua_State *L)
|
||||||
{
|
{
|
||||||
statusbar_t **sb = luaA_checkudata(L, 1, "statusbar");
|
statusbar_t **sb = luaA_checkudata(L, 1, "statusbar");
|
||||||
widget_node_t *widget;
|
widget_node_t *witer;
|
||||||
int i = 1;
|
|
||||||
|
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
|
||||||
for(widget = (*sb)->widgets; widget; widget = widget->next)
|
for(witer = (*sb)->widgets; witer; witer = witer->next)
|
||||||
{
|
{
|
||||||
luaA_widget_userdata_new(L, widget->widget);
|
luaA_widget_userdata_new(L, witer->widget);
|
||||||
/* ref again for the list */
|
/* ref again for the list */
|
||||||
widget_ref(&widget->widget);
|
widget_ref(&witer->widget);
|
||||||
lua_rawseti(L, -2, i++);
|
lua_setfield(L, -2, witer->widget->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue