lua-users home
lua-l archive

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


David wrote:

So (again, in theory) you get the client/server goodness of XWindows, but with a native look and feel on the client machine.
It would be interesting to see something like that implemented in Lua.


I needed a "control GUI" for my simulation application. I ended
implementing it with wxLua. I run a Lua interpreter embedded in
our simulator, and the wxLua based GUI in a separate (notebook)
computer. These are at the moment connected using a RS232 serial
cable and communicate by sending Lua code pieces to each other.

What is sort of cool is that the GUI-program is a really dummy one,
by itself it only opens a basically empty window, with a status line.
(And even this happens mostly for debugging reasons). First
thing it then does is send a boot request message to the simulator.

The reply for the boot-message then contains all the Lua code which
is needed for creating the real GUI.

After the bootstrap phase the GUI process continues listening
incomming communications in the wxLua idle callback. When user
press buttons etc on the GUI it sends corresponding command strings
to the Lua embedded in the simulator.

This took me only couple of days to implement, and most of the time
went in implementing the serial port communication part. Using something
like a TCP/IP protocol would have been much easier.

		Eero