diff options
author | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:56:41 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:59:33 -0800 |
commit | d577d991b97ae2b5ee1af23641bcffc3f83af5b2 (patch) | |
tree | 590639d50205d1bcfaff2a7d2dc6ebf3f373c7ed /iup/srclua3/il_cbox.c |
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'iup/srclua3/il_cbox.c')
-rwxr-xr-x | iup/srclua3/il_cbox.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/iup/srclua3/il_cbox.c b/iup/srclua3/il_cbox.c new file mode 100755 index 0000000..9dc388d --- /dev/null +++ b/iup/srclua3/il_cbox.c @@ -0,0 +1,36 @@ +/** \file + * \brief Bindig of iupcbox to Lua 3. + * + * See Copyright Notice in "iup.h" + */ +#include <stdlib.h> + +#include <lua.h> + +#include "iup.h" + +#include "iuplua.h" +#include "il.h" +#include "il_controls.h" + +static void CreateCbox(void) +{ + int tag = (int)lua_getnumber(lua_getglobal("iuplua_tag")); + Ihandle** params = iuplua_checkihandle_array(1); + lua_pushusertag(IupCboxv(params),tag); + free(params); +} + +int cboxlua_open (void) +{ + lua_register("iupCreateCbox",CreateCbox); + + return lua_dostring("IUPCBOX = {parent = IUPCANVAS}\n" + "function IUPCBOX:CreateIUPelement (obj)\n" + " return iupCreateCbox (obj, getn(obj))\n" + "end\n" + "function iupcbox (o)\n" + " return IUPCBOX:Constructor (o)\n" + "end\n" + "iup.cbox = iupcbox\n"); +} |