Wgy isn't there a good RAD Gui tool fo python

sturlamolden sturlamolden at yahoo.no
Tue Jul 12 03:42:09 CEST 2011


On 12 Jul, 01:33, Dave Cook <davec... at nowhere.net> wrote:

> I prefer spec-generators (almost all generate XML these days) like
> QtDesigner to code-generators like Boa. I've only seen one good
> argument for code generation, and that's to generate code for a layout
> to "see how it's done".  But code could always be generated
> automatically from a spec.

wxFormBuilder will produce C++, Python and XML. Pick the one you like!

The advantage of using XML in tools like GLADE, QtCreator, and more
recently Visual C#, is separation of layout and program logic. The
problem with code generators like Visual C++ or Delphi was the mixing
of generated and hand-written code.

However, there is no real advantage over using XML instead of C++ or
Python: C++ and Python code are also structured text. One structured
text is as good as another: "There once was a man who had a problem.
He said: 'I know, I will use XML.' Now he had two problems."

When using wxFormBuilder, the generated .cpp, .h, .py or .xrc files
are not to be edited.

To write event handlers, we inherit from the generated classes. Thus,
program view (generated code) and program control (hand-written code)
are kept in separate source files.

Because C++ and Python have multiple inheritance, we can even separate
the program control into multiple classes. What we instantate is a
class that inherit the designed dialog class (generated) and event
handler classes (hand-written).

Therefore, XML has no advantage over Python in the case of
wxFormBuilder. XML just adds a second layer of complexity we don't
need: I.e. not only must we write the same program logic, we must also
write code to manage the XML resources. Hence, we are left with two
problems instead of one.

This is not special for wxFormBuilder: In many cases when working with
Python (and to somewhat lesser extent C++), one is left to conclude
that XML serves no real purpose.

Sturla







More information about the Python-list mailing list