wxPython syntax

Andrei project5 at redrival.net
Mon Jun 28 05:48:06 EDT 2004


OKB (not okblacke <BrenBarn <at> aol.com> writes:

> 	I've started taking a look at wxPython, and, well, I've noticed 
> that the syntax needed to code with it is extremely ugly.  I am 
> wondering if there exist any preprocessing tools or clever refactorings 
> that allow users to write more sane-looking code.  In particular, it 

wax is supposed to be more Pythonic, but I haven't used it (yet).

> seems to me that the structure of the code often does not reflect the 
> structure of the GUI being designed.  For instance, the wxPython wiki 
> "Getting Started" guide includes this code to set up a file menu with 
> About and Exit options:
<snip>

You're right, this kind of code is ugly. Fortunately you don't *have to* write
any of it, since you can use one of the design tools available to generate all
the ugly stuff. You'll still have to live with lots of Get... and Set... methods
instead of just plain properties, but that's bearable. My fav. is wxGlade.

>     	Pieces of the code, like "filemenu" and ID_ABOUT and OnAbout, are 
> confusingly repeated throughout the definition.  Doesn't it seem like 

wxGlade won't make the id's go away though. wax will.

Yours,

Andrei







More information about the Python-list mailing list