static int matrix_bg[fg]color_cb(Ihandle *self, int p0, int p1, unsigned int *p2, unsigned int *p3, unsigned int *p4)
{
int ret;
lua_State *L = iuplua_call_start(self, "bgcolor_cb");
lua_pushnumber(L, p0);
lua_pushnumber(L, p1);
ret = iuplua_call_raw(L, 2+2, LUA_MULTRET); /* 2 args + 2 args(errormsg, handle), variable number of returns */
if (ret || lua_isnil(L, -1))
return IUP_DEFAULT;
ret = lua_tointeger(L,-1);
if (ret == IUP_IGNORE)
{
lua_pop(L, 1);
return IUP_IGNORE;
}
*p2 = (unsigned int)lua_tointeger(L, -4);
*p3 = (unsigned int)lua_tointeger(L, -3);
*p4 = (unsigned int)lua_tointeger(L, -2);
lua_pop(L, 1); -------------- this should be lua_pop(L,4);
return IUP_DEFAULT;
}