Using layouts with complex widgets like tables or trees and computeSize() [message #451948] |
Fri, 11 March 2005 11:08  |
Eclipse User |
|
|
|
I've had a consistent problem when using a GridLayout (and other layouts)
when using mutliple tree/table widgets. The problem occurs when I ask both
widgets to take up available space (whether horizontal or vertical space).
The problem is the widgets are sized in relation to their contents. For
example, I have two tables layed out one on top of the other, with both
given GridData.FILL_BOTH. Initially both are sized equally because they
have no contents. Subsequently, if I add items to one table, then cause the
layout to be recalculated (on a resize for example), then the table with the
items can take up a large amount of space, even essentially hiding the other
table.
This is not how I would intuitively want the GridLayout to work. Complex
'containing' widgets like Tables, Trees and Lists I would expect not to size
relative to their contents. Is there a way to tell the layout, not to ask
for the preferred sizing of certain widgets? Is there any way to alter this
behavior? Am I the only one to encounter this?
-Chris
|
|
|
Re: Using layouts with complex widgets like tables or trees and computeSize() [message #451949 is a reply to message #451948] |
Fri, 11 March 2005 11:13  |
Eclipse User |
|
|
|
Yes. You can set a widthHint or a heightHint. This hint overrides what
would normally be calculated with computeSize. You can still make the
widget grow larger or smaller than this value using FILL_BOTH.
"Chris" <schtoo@schtoo.com> wrote in message
news:d0sfqk$1vk$1@www.eclipse.org...
> I've had a consistent problem when using a GridLayout (and other layouts)
> when using mutliple tree/table widgets. The problem occurs when I ask
> both widgets to take up available space (whether horizontal or vertical
> space). The problem is the widgets are sized in relation to their
> contents. For example, I have two tables layed out one on top of the
> other, with both given GridData.FILL_BOTH. Initially both are sized
> equally because they have no contents. Subsequently, if I add items to
> one table, then cause the layout to be recalculated (on a resize for
> example), then the table with the items can take up a large amount of
> space, even essentially hiding the other table.
>
> This is not how I would intuitively want the GridLayout to work. Complex
> 'containing' widgets like Tables, Trees and Lists I would expect not to
> size relative to their contents. Is there a way to tell the layout, not
> to ask for the preferred sizing of certain widgets? Is there any way to
> alter this behavior? Am I the only one to encounter this?
>
> -Chris
>
|
|
|
Powered by
FUDForum. Page generated in 0.03911 seconds