Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
karmacomposer
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 26, 2019 2:14 pm

Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

Post by karmacomposer » Tue Mar 26, 2019 2:16 pm

While this is all very old, I am very new to Lua programming and specifically wxWidgets/wxLua.

I have everything in place and working, as well as wxFormBuilder and am using it (yet more to learn).

I am used to OOP and languages like Visual Basic, Basic, C, Php, HTML, CSS, MySQL and more, so Lua
should not really be too hard for me. However, since there is little to no documentation for wxLua and
wxWidgets, I am pretty lost. The docs that are available, as has been mentioned on other forums, could
literally give you a headache.

I have tried youtube for videos, but most regarding wxFormBuilder are for C++ or Python. Due to my needs
I am using Lua 5.1 (yes, I know 5.3 is available but I need 5.1 for crypto libraries and wxLua/wxWidgets)
and just need some help. If there are any tutorials or other easier to read docs, books, manuals, etc
that would be great.

Specifically, I am trying to save/load and encrypt/decrypt data using Lua and sha-256, AES or Blowfish.
I am also trying to simply code the various widgets (buttons, text controls, etc) in Lua and having a hard
time. Something as mundane as a Login and registration form that is usually very easy to do with a MySQL database
is giving me real grief in Lua.

I have gone through all the wxWidget samples and gleaned a small amount of learning from them, but I am not
grasping the overall concept. I have watched Lua tutorials on YouTube and it seems overly easy and very basic-like,
but that does not seem to be the case with wxLua and wxWidgets. I DO NOT program in C++ and have never been
able to grasp it.

I appreciate any guidance to tech support forums or learning materials.

Thank you.

Mike

User avatar
doublemax
Moderator
Moderator
Posts: 13898
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

Post by doublemax » Tue Mar 26, 2019 5:14 pm

Lua in general and wxLua in particular are not popular. The fact that the last wxLua release was almost 6 years ago probably doesn't help much with that.

I don't think there are any other resources than the ones you probably Googled yourself already.

As you have experience in many programming languages, i would just start with the wxLua samples. Start with "minimal.wx.lua" and try to understand what it does.

Then try the other samples and check if there is one that is similar to what you need (maybe 'dialog.wx.lua'?).

I think it's quite convenient that wxLua practically is its own IDE, so you can quickly make changes to the code and see what it does.
Use the source, Luke!

PaulR
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Mar 22, 2019 9:05 pm

Re: Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

Post by PaulR » Thu Mar 28, 2019 1:19 am

The code generated by wxFormBuilder for Lua wasn't really up to scratch so I've submitted an overhaul in a pull request to wxFormBuilder on GitHub(#511). I see the trouble you must have been having using it to instantiate a modal dialog, when they pops up the minute the global table was scanned.

I'm no expert either, I'm getting familiar wit the wxWidgets layout system myself. I have yet to grok the aui system in particular.

Re docs, the C++ docs are very close to how you use wxLua. Prepending everything with wx. or wxaui. is pretty much it for the most part. I refer to the top part of the wxLua docs just to see if something somehow isn't implemented and use the C++ docs for everything else. It has to be said that the published wxLua docs are out of date with the latest wxLua, so it's not a bible.

Re the latest version, a fork is now actively maintained by Paul "ZeroBrane Studio" Kulchenko and other contributors here:

https://github.com/pkulchenko/wxlua

… which has samples updated for compatibility and bindings updated for the wxWidgets 3.1.1.

Let me know if you have any questions and we'll learn some more together. :)

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3358
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

Post by ONEEYEMAN » Thu Mar 28, 2019 2:21 pm

Hi,
You should probably drop wxLua alltogether and start looking into wxPython/Phoenix.

It updates frequently and it is up-to-date with the current wxWidgets release. It also works with both python2 and 3.

This is much better solution, unless you need to support the older version of your application that was written in wxLua.

But even then - it would be better to just re-write the code in C++ or python...

Thank you.

karmacomposer
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 26, 2019 2:14 pm

Re: Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

Post by karmacomposer » Thu Mar 28, 2019 4:41 pm

Why Python? C++ is not going to happen. I need to be able to compile the end result down to byte code, use crypto libraries and more. Plus Lua works with many of my game engines.

I'd have to have a very good reason to not use Lua. Is there a biggie that will haunt me later on?

Mike

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3358
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

Post by ONEEYEMAN » Thu Mar 28, 2019 6:05 pm

Hi,
As doublemax said - last release of it happened about 6 years ago.
There are a lot of improvements, bug fixing and changes in the versions of the wxWidgets after that.

Unless you want to compile wxLua yourself I'd start looking to either main line or wxPython.

Besides - there are a lot of work coming in for HiDPI on all platforms, better support for GTK+3 (a lot of bug fixing), better support for more modern OSX.

Thank you.

P.S.: I suggested wxPython, because its translating language and you don't need to compile a lot of code yourself just to test something.

P.P.S.: What version of wxWidgets you are using?

paulclinger
In need of some credit
In need of some credit
Posts: 1
Joined: Tue Jul 02, 2019 11:56 pm

Re: Are there tutorials and a Lua reference and command documentation for wxLua and wxWidgets for Lua

Post by paulclinger » Wed Jul 03, 2019 12:09 am

@karmacomposer, I would not discard wxlua yet, as it's been working well for me and others. I've been developing a Lua IDE using wxlua (http://studio.zerobrane.com/) and, as @PaulR said, I've been updating wxlua for the most recent version of wxwidgets and has recently released v3.0.0.1, which supports wxwidgets 3.0, 3.1, 3.1.2 as well as the current master branch. The API has been updated for most of the existing classes and some new classes have been added as well.

Post Reply