Wow! You resurrected such an old thread! Thanks for your responses.

I actually solved the problem a few days after I asked the question; the method 
I used is the first method you described.  I stored the wxLuaState in a C++ 
class, queried the contacts lua file, and converted lua variables to C++ 
variables using that stack based paradigm from Lua to C++.

The resultant GUI was written in X Motif... from there everything took place.

Thanks

Carlo

-----Original Message-----
From: wxlua-users-boun...@lists.sourceforge.net 
[mailto:wxlua-users-boun...@lists.sourceforge.net] On Behalf Of John Labenski
Sent: Tuesday, August 24, 2010 10:55 PM
To: wxlua-users@lists.sourceforge.net
Subject: Re: [wxlua-users] GUI Application To Read/Edit and Write To a 
Configuration.lua file

On Tue, Jun 29, 2010 at 10:14 AM, Del Mundo, Carlo Eduardo C.
<carlo.eduardo.c.del.mu...@saic.com> wrote:
> Hi all!

Hi, sorry about the very long delay...

> After searching through the archives, I have found a few situations similar
> to my problem but few solutions.  Basically, I am writing a GUI application
> that edits a configuration.lua file that contains the following entries:
>
> ID #
>
> Color
> Roughness
> LightEmission
> Conductivity
> myAddFunction(id, color, rough, light, cond);
>
> ..... etc
>
> Note that after each entry, the myAddFunction() adds the entry to a table of
> values.  This table is then queried by a Lua-C++ interpreter.

You have a lot of options, but if I understand correctly the GUI will
be in C++. I would create a wxLuaState in C++ and call
wxLuaState::LuaDoFile(...) on your config files. You could use
wxLuaState::RegisterFunction(...) to add your C/C++ "myAddFunction" as
a function for Lua that will add the items appropriately.

> Now, I have attached an image that is a screenshot from lua.org that depicts
> a similar project (to give you perspective).  My end goal is to have a GUI
> that:
>
> 1.)    Reads the entries in the configuration.lua file (as shown above)
> 2.)    Edit Attributes per entry
> 3.)    Add a New Entry
>
> The question is, how can I achieve the three goals? Originally, I was going
> to use Java Swing and parse the configuration.lua file LINE BY LINE but
> realized this is unsophisticated and would break with a badly written input
> file.

The control shown in the image is a wxListCtrl and there's some sample
code for it below. This code may be a little complicated since it has
to sync a wxTreeCtrl with the wxListCtrl.
http://wxlua.cvs.sourceforge.net/viewvc/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp?view=markup

You could even turn it around and write all the adding code in Lua
itself and all you need to do is push your wxListCtrl into Lua using
code like this, search for "wxLua_wxListCtrl_constructor1" and see the
bottom where it calls wxluaW_addtrackedwindow() and
wxluaT_pushuserdatatype() so that it's on the stack.

http://wxlua.cvs.sourceforge.net/viewvc/wxlua/wxLua/modules/wxbind/src/wxcore_controls.cpp?view=markup

I hope this gives you some ideas,
    John Labenski

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to