From 0b5a681171024a1fbe0d30f7dca837019c38a73f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 24 Oct 2008 17:48:50 +0200 Subject: [PATCH] widget: return self for buttons Signed-off-by: Julien Danjou --- mouse.c | 1 - widget.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mouse.c b/mouse.c index 4987b345..6cec6edd 100644 --- a/mouse.c +++ b/mouse.c @@ -1146,7 +1146,6 @@ luaA_button_array_set(lua_State *L, int idx, button_array_t *buttons) button_ref(b); lua_pop(L, 1); } - lua_pop(L, 1); } /** Push an array of button as an Lua table onto the stack. diff --git a/widget.c b/widget.c index e425d6c8..24177f58 100644 --- a/widget.c +++ b/widget.c @@ -396,7 +396,10 @@ luaA_widget_buttons(lua_State *L) button_array_t *buttons = &(*widget)->buttons; if(lua_gettop(L) == 2) + { luaA_button_array_set(L, 2, buttons); + return 1; + } return luaA_button_array_get(L, buttons); }