-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I want to layout a tree and a grid inside an hbox so that the tree would take a fixed width and the grid would take the rest. I tried the following but a big whitespace appears between the tree and the grid and also the grid seems weird.
<window title="white space problem" border="normal">
<hbox width="100%">
<tree width="200px">
<treechildren>
<treeitem label="Item 1"/>
<treeitem label="Item 3"/>
</treechildren>
</tree>
<grid width="100%">
<rows><row>Row 1</row></rows>
</grid>
</hbox>
</window>
Specify an absolute width on the window and then divide it up between your tree and grid :
<window title="white space problem" border="normal" width="300px"> <hbox width="100%" > <tree width="200px"> <treechildren> <treeitem label="Item 1"/> <treeitem label="Item 3"/> </treechildren> </tree> <grid width="100px"> <rows><row>Row 1</row></rows> </grid> </hbox> </window>
Thanks for reply. But that doesn't solve my problem completely. The idea is to use as much of the browser's width as possible. I guess I can check the ClientInfo and read the desktop width but that has its own problems because I am using a similar pattern in many other places in my UI and I do not want to have to update the width in so many places when the desktop width changes. I rather this would be taken care of automatically.
hey there,
use the widths attribute of the hbox, like this:
<window title="white space problem" border="normal" width="100%"> <hbox width="100%" widths="0%,100%"> <tree width="200px"> <treechildren> <treeitem label="Item 1"/> <treeitem label="Item 3"/> </treechildren> </tree> <grid width="100%"> <rows><row>Row 1</row></rows> </grid> </hbox> </window>
Asked: 2008-07-22 20:19:08 +0800
Seen: 108 times
Last updated: Jul 23 '08