lua-users home
lua-l archive

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


> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br 
>
> 	CreateGUI
> 	{
> 		name = "Canvas",
> 		horizontal = "left",
> 		vertical = "top",
> 		position = "0 0",
> 		visible = 1,
> 		bitmap = "./bitmaps/bitmap.jpg",
> 		size = "640 480"
> 	}
> 
> 	CreateComponent
> 	{
> 		type = "ClockComponent",
> 		parent = "Canvas",
> 		name = "Clock",
> 		horizontal = "left",
> 		vertical = "top",
> 		position = "0 0",
> 		visible = 1,
> 		size = "100 100"
> 	}
> 
> But I haven't found how to parse through this from within C. 
> Are there any 
> examples of this somewhere, or could someone give me a few 
> pointers how to walk 
> through this in C?


Have a look at http://doris.sf.net/ (click on the pictures for examples)
I put a tolua wrapper around the GLUI OpenGL widget framework and then a
Lua wrapper around this so that you don't have to use C++ style syntax
in Lua. I think this is what you are trying to do. You don't "parse" the
data description you have given, you execute it as a script and
CreateGUI and CreateComponent create widgets. ie. all of the args in the
curly brackets are parameters passed to the Create* functions.

Regards,
Nick