As I want to do some GUI stuff in Lua, I settled on the wxLua library that happens to be shipped with Lua for Windows.
The thing is not so easy to figure out though. I'll keep tabs on this page here about my questions and, hopefully, some answers - both for myself and possibly for anyone else new to Lua/wxLua.
Not sure. There is a so-called wxLua Reference Manual, but it is very hard to read, contains no examples and all the types are in C++ lingo rather than Lua.
I thought there should be a bunch of .lua files describing the API somewhere in the wxLua source distribution - but I couldn't find that either. What's going on there?
As many others, I found out that Lua's print function stops working as soon as you start up wxLua. Well, it still does something: It pops up a message box everytime you print a line. I was actually hoping I could just use the console as before while displaying GUI windows at the same time. Heck, Java can do that too.
I don't know if there is any way to still access stdout or stderr while using wxLua. In the meantime, I am trying something else. I'll open a log window which is, thankfully, quite easy with wxLua:
w = wx.wxLogWindow(wx.NULL, "Safe Lua Log")
Then, you log something with:
wx.wxLogMessage("hello world")
It's all nice and dandy. The only problem I have now is that the application keeps running after I close the log window. You don't see it anymore, but it's still in the task list. So I should attach an event listener to the log window I guess. Tried that:
w:Connect(wx.wxEVT_CLOSE_WINDOW, function (event) os.exit() end)
...but there is no Connect method in the log window (there is in Dialog class, but apparently log windows are different). So how do I do it? I don't know yet.
Anonymous
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
I am frustrated by the wxLua Reference Manual also. I had to study the wxLua examples to learn the syntax. The wxWidgets Class Reference was more useful.
Last edit: Anonymous 2017-05-22