History : 2008/8/22 updated. fixed wxFrame issues (statusbar/toolbar/deep menubar)
2008/7/20 created this page
Summary :
It's a patch for wxGlade that make wxGlade to generate GUI code
that works with wxLua.
wxGlade
is a GUI designer for wxWidgets, works on wxPython.
it
can generate GUI code for wxPython, wxPerl, and some others. With this
patch, it can generate GUI code for wxLua.
Plus, a little modification to wxGlade.
- empty sizer slots will not
harm generated GUI layout.
- fix some issues about initial size of widgets.
Status : - Most of the widgets on wxGlade will work but
not tested well.
- The generated main loop may not good. (the process of
wxlua.exe will not disappear after closing the GUI)
- I want to integrate the patch to wxGlade core repository.
Requirements : wxGlade-0.6.3
wxLua : 2.8.7.0 (or later ?)
wxWidgets : 2.8.7.0 (or later ?)
Python : 2.5 (or later ?)
wxPython : 2.8.7.1 (or later ?)
Windows XP (verified), Linux or other (not verified)
Instructions to
patch wxGlade :
- Download GnuWin32 patch.exe (Download page)
- Download wxGlade-0.6.3 source (wxGlade-0.6.3.zip) from wxGlade download page and extract.
- Download the patch
above and extract .patch and place it on wxGlade-0.6.3
directory
- cd to that wxGlade-0.6.3 directory, and apply patch.
generated Lua code is here.
(You need wxglade_util.lua
to run this script on wxLua.)
How to generate code
- create your GUI with wxGlade
- open wxGlade property window of the Application
- select lua
as language
- set output path
- and click "generate code" button
- copy wxGlade-0.6.3/wxglade_util.lua (or this) to your script directory.
- execute lua script with wxlua like this. (Drag&Drop will not
work here)
wxlua.exe test.lua
Some tips on code
generation :
If "overwrite existing sources" check on the property is OFF, wxGlade
will only change between these lines :
(wxGlade will NOT change here)
-- begin wxGlade: *****
(wxGlade will change here)
-- end wxGlade
(wxGlade will NOT change here)
So, you can update your GUI, while you write some logic on the code. But please be
careful, and you should back up your code.
It can LOST YOUR CHANGES when something is wrong on wxGlade code
generation.
Another complex example
:
(not complete project of mine)