up with PyGUI!
Hans Nowak
hans at zephyrfalcon.org
Thu Sep 23 09:32:11 EDT 2004
anton muhin wrote:
> I beg your pardon for possibly stupid comment---I haven't practice GUI
> programming for a long time, especially in Python. However I mostly
> prefer declarative approach for the problems like that. Therefore,
> wouldn't it be interesting to describe the structure with class and
> metaclass mechanism, like:
>
> class MainFrame(FrameDescription):
>
> class b1(ButtonDescription):
> size = (40, 40)
> text = "b1"
>
> etc.
>
> with the best regards,
> anton.
Yes. But not in Wax. :-) The way Wax works is pretty much set in stone, and
although there is room for many improvements and shortcuts (passing layout in
constructor, auto-packing, etc), I'm not going to rewrite it so it supports the
above. It's meant as a friendly layer on top of wxPython; as such, I want it
to stay rather close to wxPython, so I'm less interested in writing an
innovative API.
Aside from that, I'm not sure if the construct described above is all that
great... it makes nested classes significant, and uses class attributes to
describe an instance (unless b1 is meant as a template for other buttons). It
also requires a bunch of magic "under the hood". I'd rather use less
surprising constructs. But that's just a matter of opinion; YMMV.
Cheers,
--
Hans Nowak (hans at zephyrfalcon.org)
http://zephyrfalcon.org/
More information about the Python-list
mailing list