summaryrefslogtreecommitdiff
path: root/iup/srclua3/il_cbox.c
blob: 9dc388d551e9592bb25721492db4c68214c720fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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");
}