An attempt to use a python-based mini declarative language for form definition
Carlos Ribeiro
carribeiro at gmail.com
Wed Sep 22 15:50:57 EDT 2004
On Wed, 22 Sep 2004 20:04:21 +0200, Thomas Heller <theller at python.net> wrote:
> No, there is no way. But there is a trick you can use (I've played with
> stuff like this, in a different context, in the past): You can use an
> instance variable or global in the TextBox callable, that is incremented
> on each call. This counter is somehow attached to the object that
> TextBox returns, and lets you order these objects afterwards. Makes
> sense?
I think that it does. Actually, I had a pretty much more ellaborate
idea that rely on a *lot* of introspection for the same effect. It's
not for the faint of heart :-)
It goes like this: inside the TextBox constructor, raise an exception,
capture the stack frame, and check from where was it called. I think
there's enough information at this point to order the elements. As I
said, not for the faint of heart, and it smells like a terrible hack.
I'll check this and other similar ideas. Thanks again,
--
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