Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Using layouts with complex widgets like tables or trees and computeSize()
Using layouts with complex widgets like tables or trees and computeSize() [message #451948] Fri, 11 March 2005 16:08 Go to next message
Chris Gross is currently offline Chris GrossFriend
Messages: 471
Registered: July 2009
Senior Member
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 16:13 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
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
>
Previous Topic:cursor set incorrectly for JSplitPane with SWT embedded swing
Next Topic:Issues with tablecolumn header
Goto Forum:
  


Current Time: Wed Sep 30 22:06:41 GMT 2020

Powered by FUDForum. Page generated in 0.13948 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top