An attempt to use a python-based mini declarative language fo r form definition

Carlos Ribeiro carribeiro at gmail.com
Wed Sep 22 16:14:47 EDT 2004


[Facundo Batista] 
> There should be some way to pass the "location". If you solve this, 
> you got your answer (of course, passing the "location" is not trivial,
>  that's why every GUI toolkit has it own approach).

That's *exaclty* the root of my problems. I don't want to specify
positioning; I only want to use *relative positioning* for everything,
working as automatically as possible. Will it work for all situations?
I'm not sure. But I think it's worth investigating.

What I intend to do is to borrow some of the layout techniques defined
by CSS+DHTML. It is *much* more complex that this, but it basically
works by formatting "block level" and "inline elements" elements
relatively to each other. You can give hints as to the relative
positioning -- absolute, relative, floating to the left, floating to
the right, and stuff like that. The layout engine positions everything
according to the constraints. If the engine doesn't support advanced
layout, it simply falls back to a simple sequence of entries according
to the original text flow.

There are two reasons behnd my choice:

-- there is a lot of knowledge today about how to make good interfaces
using CSS. It's faster to develop and is more flexible regarding
different engines and platforms than to rely on absolute positioning
(as conventional GUI builders do)

-- it makes *much* easier to use the same form definition on native
GUIs and web-based ones. My goal is to be able to build a wxPython
dialog or a web form from the same description.

That's why I can't give positioning hints, at least for now. But I
could include relative ordering information; for example, an arbitrary
tag number. But doing this I would defeat my objective of clarity of
design.

-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list