wxPython GUI designer

Don Taylor nospamformeSVP at gmail.com
Mon Jun 19 21:00:06 EDT 2006


aum wrote:
> On Sun, 18 Jun 2006 13:09:08 -0700, diffuser78 wrote:
> 
>> I am newbie learning wxPython. I tried using GUI designer called
>> wxGlade. When it generated code I couldnt get the same level of
>> flexibility as writing the code by oneself.
>>
>> Any view on what you think about using GUI designer tools.
>>
>> Every help is appreciated.
> 
> I use wxGlade all the time, and find it's great. My only complaint is that
> there are some controls it doesn't know about, such as wx.HtmlWindow, and
> I have to add these controls in wxGlade as 'custom' controls. But to me,
> that's pretty minor.
> 
> To get the best out of wxGlade, you really need to subclass the classes
> that wxGlade generates. Don't look to wxGlade to write your app for you.
> It's there for gui structure (the 'view'), and it's up to you to flesh out
> the 'controller' side.
> 
> So I'd recommend you persist with wxGlade - subclass all the classes that
> wxGlade generates, and add your own methods to handle events, set up the
> gui as you want, and (in some rare cases) do some extra initial bindings.
> 
> I typically set wxGlade to generate a file called 'myapp_ui.py', and I
> write my own 'myapp.py', in which I 'import myapp_ui', then subclass the
> wxGlade-generated classes in 'myapp_ui'.
> 
> Works a treat for me, and saves a lot of time compared to hand-coding the
> GUI.
> 

I second this approach to using wxGlade, it works really well although I 
have not seen it documented anywhere.

I am not sure if 'aum' meant this, but I let wxGlade generate the event 
methods for me in 'myapp_ui.py' and then override them in 'myapp.py'. 
You have full control over the code in your own 'myapp.py' and you 
rarely have to mess with 'myapp_ui.py' so you can let wxGlade keep 
control of that file.

wxGlade does not support GridBag sizers, which is a shame, but otherwise 
  its support for sizers is good.  I find it easy to use sizers in 
wxGlade.  Pythoncard does not yet support sizers and I have never been 
able to get Boa's sizers to work consistently.

wxGlade is a bit flaky on Windows but if you save often then it is OK.

I was unsure about it at first, but now I like wxGlade's notion of not 
being a full-up IDE as it lets me choose the rest of the tool chain. 
wxGlade will play happily with anything: vim, emacs, Eclipse/Pydev, 
etc...


Don.




More information about the Python-list mailing list