[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: IUP 2.3 and Lua 5.0.2
- From: "R. Frazier" <rtdoger@...>
- Date: Sun, 27 Mar 2005 18:04:54 -0500
Thanks! I got the script working with the following changes:
ok_button = iup.button { title = "Ok", bgcolor = WHITE }
cancel_button = iup.button { title = "Cancel", bgcolor = WHITE }
dialog = iup.dialog { ok_button, cancel_button; title = "Confirmation", }
dialog:show()
Check the documentation, all the functions are documented in C and in Lua.
There are also many examples.
I did read these docs:
iup2_3.chm
And you do have examples, but these are examples on the C coding side. I
could not
find any examples how to initialize and load a scripted IUP file using Lua
5.0.2.
For example, if you do a search for the function iuplua_dofile(), there are
absolutely
no example references found.
I would like to see docs on how to initialize a scripted IUP file using Lua
5.0.2,
using the function iuplua_dofile(). I would like to see comments for each
line,
explaining why it is needed, and explaining why the order of initialization
is
important. I'm really interested in the big picture.
From: Antonio Scuri <scuri@tecgraf.puc-rio.br>
Reply-To: Lua list <lua@bazar2.conectiva.com.br>
To: Lua list <lua@bazar2.conectiva.com.br>
Subject: Re: IUP 2.3 and Lua 5.0.2
Date: Sun, 27 Mar 2005 18:45:26 -0300
Hi,
We are using the namespace "iup", so IupButton in Lua 5 became
iup.button, and so on.
Also "dialog" does not have a "display" member funciton, replace it by
"show".
Check the documentation, all the functions are documented in C and in
Lua. There are also many examples.
Best,
scuri
At 19:59 26/3/2005, R. Frazier wrote:
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*.
_________________________________________________________________
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*.