A patch for wxGlade

 to generate GUI code for (wx)Lua


land.to

>> main page

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.

Download :
 wxGlade_for_lua_preview4_patch.zip (2008/8/22)

License :
Same as wxGlade. So it's MIT license.

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.

  patch -p1 < wxGlade_for_lua_preview4.patch

To run wxGlade :
 - Install recent Python (Python download page)
 - Install wxPython (wxPython download page)

 - then execute wxglade.py to launch wxGlade.

  python.exe wxglade.py


Screenshots :

wxGlade main window (very normal) :


Property of "Application" :


wxGrade designer :


Preview (wxPython):


generated GUI code for wxLua:


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

How to launch your GUI
 - Install wxLua-2.8.7.0 (wxLua download page)

 - 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)

in wxGlade tree window :


wxGlade designer :



wxGlade preview (wxPython) :


generated GUI code for wxLua :


That's all.

comments to V Y A 0 4 2 3 0 at n i f t y dot com