Ed Leafe wrote:
On Oct 7, 2005, at 7:03 PM, Carl Karsten wrote:
So you can't define a Address UI like this:
addr1
addr2
city st zip
Sure you can. Are you saying that you need absolute positioning to
do that?
Assuming that you have controls named as you have them above:
# Create a vertical sizer
vsz = dabo.ui.dSizer("v", Border=3, BorderAll=True)
# Add the addr lines
vsz.append(addr1, 0, "expand")
vsz.append(addr2, 0, "expand")
# Create a horizontal sizer for the CSZ line
hsz = dabo.ui.dSizer("h")
hsz.append(city, 1, "expand")
hsz.append(st, 0)
hsz.append(zip, 0)
# Add the horizontal sizer to the vertical
vsz.append(hsz, 0, "expand")
# Force the sizers to resize
self.layout()
This will result in the layout you expect, with three lines that
remain constant in height, but which will expand left to right to fill
the available space. There will be a 3-pixel border around each row.
Don't worry if you don't get all the parameters just now. After a
while, they'll seem second nature; for now, just see if you can picture
the layout process.
I think I get it. I definatly get it enough to get back to my IDE musings.
So the above would be saved as nested XML, and then at run time some sort of
nested object that "looks" like this:
vsz
+-addr1
+-addr2
\-hsz
+-city
+-st
\-zip
In some sort of lisp like notation:
( addr1, addr2, ( city, st, zip ) )
Or in pointer values:
( 1, vsz, null )
( 2, addr1, 1 )
( 3, addr2, 1 )
( 4, hsz, 1 )
( 5, city, 4 )
( 6, st, 4 )
( 7, zip, 4 )
(lots more properties are stored, but im ignoring them to keep the "pictures"
simple.)
So somehow this structure is in memory, and then something can render into what we
see on the screen.
How close am I?
^C
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users