Discussion:
Porting a lua program with GUI to windows
Michael Gerbracht
2013-01-04 14:01:02 UTC
Permalink
Hello,

I have written a complex lua program including a highly complex GUI on a
small platform (RISC OS). It's all done in pure lua code. Now I would like to
port this program to windows and - if possible - to Mac OS and Linux as well.
It is planned to be a commercial product and it needs high end GUI support -
which seems to be a problem. I already started twice to port the software.

First I tried wxlua but it did not work in the way I needed it to work (can't
remeber exactly what was the problem).

Then I tried lqt but I also ended up with instabilitites and a problem with
calling privat methods.

Now I am thinking about looking into .net and luainterface. But before I
start again I would like to ask you whether this would be a good decision. It
is not as platform independent as the other toolkits I tried first but with
Mono it might be possible to use it on Linux (and Mac OS?) - but platform
independence does not have the highest priority for me.

The program focuses on data analysis and producing scientific graphs. I need
support for the following features in luainterface:
- The main program is a lua program which holds all the data and does all
calculations and I would also like to deal with all windows, dialogs etc.
from within lua.
- (I do not want to just call some lua function from C or C#)
- GUI requirements:
- drag & drop, for example: select some columns of a table and drag them
to another position in this table
- Support for Ribbons or at least tabbed toolbars
- Support Tabs like in a browser
- Select columns/rows in a data table from within lua code
- Is there anything that can be done when using .net with C++/C#, which
is not possible with lua/luainterface?
- Is the project still beeing developed and is there a place to get help
(here in this list?)
- Is the latest version of .net and lua supported (I am not using lua 5.2
features ATM, but there may be demand in future)?

Are there other alternatives I did not think of? If it is not possible to
write a full GUI application with lua, I was thinking of splitting GUI and
main program. So I would then use my lua program as something like a server
and write a GUI Client in C++/C#.

So would you recommend to use luainterface or do you think that a
client/server solution would be the better choice?

Thanks,
Michael Gerbracht
Patrick
2013-01-04 14:05:47 UTC
Permalink
Post by Michael Gerbracht
Hello,
I have written a complex lua program including a highly complex GUI on a
small platform (RISC OS).[snip ]
Hi Michael

I am in the exact same position as you. This thread is going to be
really interesting.

Have you thought about gtk? It can run on windows and there is a new
binding:
https://github.com/pavouk/lgi/ ( don't specifically know this binding
works on windows though)

-Patrick
Marc Balmer
2013-01-04 14:17:56 UTC
Permalink
We use two different GUI toolkits in mission critical systems with very good experiences, one is GTK+ and the other is Motif, for both we created our own Lua binding, the one for Motif is open source. As for tabular input, xbae exists for Motif, which does exactly that.

I am, however, not aware that Motif would run on anything not Unix. And then there is some people who claim it's ugly (but they probably just don't know how to customize the look and feel ;)

Freundliche GrĂ¼sse,
micro systems

Marc Balmer

--
Marc Balmer
micro systems, Wiesendamm 2a, Postfach, 4019 Basel
fon +41 61 383 05 10, fax +41 61 383 05 12, http://www.msys.ch/
Patrick
2013-01-04 17:40:25 UTC
Permalink
We use two different GUI toolkits in mission critical systems with very good experiences, one is GTK+ [snip]
Hi Mark

I am seriously mixed up about GUI programming. If I just really liked
C/C++ things would be easy but I want to use Lua and Ada which makes
things hard. Ada is really easy to read but GTK-Ada is incomprehensible.
It looks like might have to write in C.

You made your own GTK binding. Do you have any feedback on lgi ? I
looked through it's C code quickly but didn't understand it. Lua-gnome
appeared to insert lua C api into widgets in order to interact with
them. Is this the approach your company took?
steve donovan
2013-01-04 14:56:04 UTC
Permalink
Post by Michael Gerbracht
Now I am thinking about looking into .net and luainterface. But before I
start again I would like to ask you whether this would be a good decision. It
is not as platform independent as the other toolkits I tried first but with
Mono it might be possible to use it on Linux (and Mac OS?) - but platform
independence does not have the highest priority for me.
LuaInterface works fine on .Net and Mono (see [1], which is a
backported LuaInterface version that uses P/Invoke against a native
Lua 5.1 dll/so )

The examples given are Gtk# but obviously Windows Forms would be
preferred on Windows - this is partially implemented on Mono but the
results aren't very good looking.

Practically anything that can be done in C# can be done in
LuaInterface, and usually more elegantly by use of first class Lua
functions. I've been able to directly use NPlot from LuaInterface
programs, which is a good charting library, well suited to scientific
work.

Current maintainers seem a bit asleep but I recently worked on the
inner details so I should be able to remember what's going on ;)

steve d.

[1] https://github.com/stevedonovan/MonoLuaInterface
Bo HOU
2013-01-04 15:59:19 UTC
Permalink
Have you tried lua IUP? I have made a similar scientific program with it
one year ago. It works well in Linux and Windows. I hvn't tried it on Mac
OS. But I don't think there would be a problem.

Lua IUP: http://www.tecgraf.puc-rio.br/iup/

Regards,

Bo
Post by Michael Gerbracht
Post by Michael Gerbracht
Now I am thinking about looking into .net and luainterface. But before I
start again I would like to ask you whether this would be a good
decision. It
Post by Michael Gerbracht
is not as platform independent as the other toolkits I tried first but
with
Post by Michael Gerbracht
Mono it might be possible to use it on Linux (and Mac OS?) - but platform
independence does not have the highest priority for me.
LuaInterface works fine on .Net and Mono (see [1], which is a
backported LuaInterface version that uses P/Invoke against a native
Lua 5.1 dll/so )
The examples given are Gtk# but obviously Windows Forms would be
preferred on Windows - this is partially implemented on Mono but the
results aren't very good looking.
Practically anything that can be done in C# can be done in
LuaInterface, and usually more elegantly by use of first class Lua
functions. I've been able to directly use NPlot from LuaInterface
programs, which is a good charting library, well suited to scientific
work.
Current maintainers seem a bit asleep but I recently worked on the
inner details so I should be able to remember what's going on ;)
steve d.
[1] https://github.com/stevedonovan/MonoLuaInterface
Michael Gerbracht
2013-01-05 10:21:21 UTC
Permalink
In article
Post by Bo HOU
Have you tried lua IUP? I have made a similar scientific program with it
one year ago. It works well in Linux and Windows. I hvn't tried it on Mac
OS. But I don't think there would be a problem.
Lua IUP: http://www.tecgraf.puc-rio.br/iup/
Thanks, I did not know IUP. It looks very good! Still I fear that it will
miss some special features I may need for my program. There are a lot of
scientific programs out there and my motivation for writing another one is
the GUI which is often lacking on other programs. So I do not want to accept
any compromise on the GUI - I want it the way I have in my mind. Maybe it's
not fair because I only had a quick look on IUP but I just guess that it has
less features when compared to .net which seems to work with lua.

Michael
Coda Highland
2013-01-04 16:24:39 UTC
Permalink
Post by steve donovan
Post by Michael Gerbracht
Now I am thinking about looking into .net and luainterface. But before I
start again I would like to ask you whether this would be a good decision. It
is not as platform independent as the other toolkits I tried first but with
Mono it might be possible to use it on Linux (and Mac OS?) - but platform
independence does not have the highest priority for me.
LuaInterface works fine on .Net and Mono (see [1], which is a
backported LuaInterface version that uses P/Invoke against a native
Lua 5.1 dll/so )
The examples given are Gtk# but obviously Windows Forms would be
preferred on Windows - this is partially implemented on Mono but the
results aren't very good looking.
Practically anything that can be done in C# can be done in
LuaInterface, and usually more elegantly by use of first class Lua
functions. I've been able to directly use NPlot from LuaInterface
programs, which is a good charting library, well suited to scientific
work.
Current maintainers seem a bit asleep but I recently worked on the
inner details so I should be able to remember what's going on ;)
steve d.
[1] https://github.com/stevedonovan/MonoLuaInterface
If OSX is an important target, avoid using GTK and Mono -- it doesn't
jive with typical Mac interface behaviors (which will annoy users) and
the performance is pretty terrible.

/s/ Adam
Michael Gerbracht
2013-01-05 10:25:56 UTC
Permalink
In article
If OSX is an important target, avoid using GTK and Mono -- it doesn't jive
with typical Mac interface behaviors (which will annoy users) and the
performance is pretty terrible.
Ok, that's good to know! Windows is first priority but Mac OS would be nice,
too. Is there any way to write GUI applications using lua for Mac OS except
lqt?

Michael

Michael Gerbracht
2013-01-05 10:14:07 UTC
Permalink
In article
Post by Michael Gerbracht
Now I am thinking about looking into .net and luainterface. But before I
start again I would like to ask you whether this would be a good
decision. It is not as platform independent as the other toolkits I tried
first but with Mono it might be possible to use it on Linux (and Mac OS?)
- but platform independence does not have the highest priority for me.
Practically anything that can be done in C# can be done in LuaInterface,
and usually more elegantly by use of first class Lua functions. I've been
able to directly use NPlot from LuaInterface programs, which is a good
charting library, well suited to scientific work.
Thanks, that sounds very good! Can you describe what is the best way to start
with .net and lua? Does it make sense to install Visual Studio? Can you
design the windows etc. with a graphical editor and access them from lua? Or
is it better to design everything as lua code?
Current maintainers seem a bit asleep but I recently worked on the inner
details so I should be able to remember what's going on ;)
That sounds good, too! I hope I will be able to use it without too much help,
but experience shows that there often remain some questions...

Michael
Continue reading on narkive:
Loading...