summaryrefslogtreecommitdiff
path: root/iup/srclua3/iuplua_olecontrol.c
blob: f30271367fc18eb5d3e2e57daba22343567e156f (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
/** \file
 * \brief Bindig of iupole to Lua 3.
 *
 * See Copyright Notice in "iup.h"
 */
 
#include <stdlib.h>

#include <lua.h>
#include <lauxlib.h>

#include "iup.h"
#include "iupole.h"
#include "iupluaole.h"

static void createOleControl (void)
{
  int tag = (int)lua_getnumber(lua_getglobal("iuplua_tag"));
  lua_pushusertag(IupOleControl(luaL_check_string(1)),tag);
}

int iupolelua_open (void)
{
  lua_register("iupCreateOleControl",createOleControl);

  return lua_dostring("IUPOLECONTROL = {parent = WIDGET}\n"
                      "function IUPOLECONTROL:CreateIUPelement (obj)\n"
                      "  return iupCreateOleControl (obj[1])\n"
                      "end\n"
                      "function iupolecontrol (o)\n"
                      "  return IUPOLECONTROL:Constructor (o)\n"
                      "end\n"
                      "iup.olecontrol = iupolecontrol\n");
}