lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


IUP 2.3 and Lua 5.0.2

I'm trying to create a scripted dialog box with IUP 2.3 and Lua 5.0.2,
yet the script fails.  Does IUP 2.3 work with Lua 5.0.2 or is it broken?
If not, then what is wrong with this test example?

I'm using pre-compiled libs from IUP 2.3 and CD 4.3:
iup2_3_vc6.tar.gz
cd4_3_vc6.tar.gz

script error:
test.lua:1: attempt to call global `IupButton' (a nil value)
stack traceback:
	test.lua:1: in main chunk

script:
ok_button = IupButton { title = "Ok", bgcolor = WHITE }
cancel_button = IupButton { title = "Cancel", bgcolor = WHITE }
dialog = IupDialog { ok_button, cancel_button; title = "Confirmation", }
dialog:display()

code:
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

#include "iup.h"
#include "iuplua.h"
#include "iupcontrols.h"
#include "luacontrols.h"

void
main() {

IupOpen();
IupControlsOpen();

lua_State *L = lua_open();

luaopen_base(L);
luaopen_io(L);
luaopen_string(L);
luaopen_math(L);
luaopen_table(L);
luaopen_debug(L);

iuplua_open(L);
controlslua_open(L);

iuplua_dofile( L, "test.lua" );
IupMainLoop();

IupClose();
IupControlsClose();

lua_close(L);
L = NULL;
}

_________________________________________________________________
Take advantage of powerful junk e-mail filters built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.