up with PyGUI!

OKB (not okblacke) brenNOSPAMbarn at NObrenSPAMbarn.net
Thu Sep 23 23:31:10 CEST 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"

    	I've recently been working on a system that lets you do that kind 
of thing.  It's a set of metaclasses that wrap the wxPython classes so 
you define your GUI with nested class structures.  Certain things are 
hard here because of the way class definitions are handled in Python, 
but I am making progress.

    	If anyone's interested, you can see an example of what the GUI code 
looks like at http://www.brenbarn.net/misc/idealgui.txt .  This is code 
that actually produces a working program with my current setup.  It 
won't work for anyone else, of course, because I haven't made my library 
available yet.  My main goal here, though, is to get it so the code 
LOOKS nice, so just seeing how the code looks will give you an idea of 
the style.

--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is
no path, and leave a trail."
	--author unknown

More information about the Python-list mailing list