Python GUI

Paul Prescod paul at prescod.net
Tue Aug 10 09:30:13 EDT 1999


Have you looked into XUL, XwingML and Glade?

http://www.oasis-open.org/cover/xul.html
http://www.bluestone.com/xml/XwingML/
http://glade.pn.org/

I don't know whether these are exactly the same as what you are doing
but they are certainly related -- and both already have implementations.
Glade's is already in Python!

Phil Hunt wrote:
> 
> It is important to me that the tool is easy to use. This is because
> I intend to use it myself!

Obviously ideas of ease of use vary. Some might say that XML is easier
to use because:

 * all major text editors have a mode for it

 * it can be trivially parsed with existing code written in several
languages

 * APIs for tree manipulation are well known

 * the syntax is (becoming) familiar

 * XML transformation languages (including some nice Python libraries)
can convert your language into XUL and vice versa -- or whatever else
comes along (and I have a feeling several of these interface description
languages will come along ... there will likely be as many as there are
widget toolkits)

You are certainly free to do it however you want. It's your language and
it should be something you are comfortable with!

> Also, IIRC XML is restrictive where it allows comments -- you can't put
> them just anywhere. 

You can put them between elements. That is almost always enough...

> It will also use the C preprocessor, so for example one could
> write a macro for a label and associated textfield:
> 
> #define labelTF(txt,id,size) \
>    label @id##Label txt textField @id cols=size

XML has a similar facility but I think that textual preprocessing is a
little gross whether done in C or XML. I would encourage you to consider
structured alternatives. Whether you use C-syntax or XML syntax, you
could rather have a first-class "object definition" syntax. SVG has such
a thing for defining 2-dimensional shapes.

 Paul Prescod




More information about the Python-list mailing list