0

Problem in laying out a grid and a tree inside an hbox

asked 2008-07-22 20:19:08 +0800

siamakh gravatar image siamakh
39

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>

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2008-07-23 12:36:16 +0800

ansancle gravatar image ansancle
327 9

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>

link publish delete flag offensive edit

answered 2008-07-23 14:20:55 +0800

siamakh gravatar image siamakh
39

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.

link publish delete flag offensive edit

answered 2008-07-23 16:20:13 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

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>

link publish delete flag offensive edit

answered 2008-07-23 19:50:00 +0800

siamakh gravatar image siamakh
39

Thanks you! That fixed it.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-07-22 20:19:08 +0800

Seen: 108 times

Last updated: Jul 23 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More