From eed0eb6a476d54ce19aeff137984aa981d9e3976 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 15 Jun 2010 00:59:57 -0700 Subject: Upgrading to iup 3.1 --- iup/srclua5/il_tree_aux.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'iup/srclua5/il_tree_aux.c') diff --git a/iup/srclua5/il_tree_aux.c b/iup/srclua5/il_tree_aux.c index 99e721b..6ebaa09 100755 --- a/iup/srclua5/il_tree_aux.c +++ b/iup/srclua5/il_tree_aux.c @@ -151,12 +151,26 @@ static int tree_multiselection_cb(Ihandle *ih, int* ids, int p1) return iuplua_call(L, 2); } -static int tree_noderemoved_cb(Ihandle *ih, int id, void* p1) +static int tree_multiunselection_cb(Ihandle *ih, int* ids, int p1) +{ + int i; + lua_State *L = iuplua_call_start(ih, "multiunselection_cb"); + lua_newtable(L); + for (i = 0; i < p1; i++) + { + lua_pushnumber(L,i+1); + lua_pushnumber(L,ids[i]); + lua_settable(L,-3); + } + lua_pushnumber(L, p1); + return iuplua_call(L, 2); +} + +static int tree_noderemoved_cb(Ihandle *ih, void* p1) { lua_State *L = iuplua_call_start(ih, "noderemoved_cb"); - lua_pushnumber(L, id); tree_push_userid(L, p1); - return iuplua_call(L, 2); + return iuplua_call(L, 1); } void iuplua_treefuncs_open (lua_State *L) @@ -164,6 +178,7 @@ void iuplua_treefuncs_open (lua_State *L) iuplua_dostring(L, "IUPTREEREFTABLE={}", ""); iuplua_register_cb(L, "MULTISELECTION_CB", (lua_CFunction)tree_multiselection_cb, NULL); + iuplua_register_cb(L, "MULTIUNSELECTION_CB", (lua_CFunction)tree_multiunselection_cb, NULL); iuplua_register_cb(L, "NODEREMOVED_CB", (lua_CFunction)tree_noderemoved_cb, NULL); /* In Lua 5: -- cgit v1.2.3