Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSWT Table
https://www.eclipse.org/forums/index.php/mv/msg/147102/463148/#msg_463148
Originally posted by: davidyoung_2001.yahoo.co.uk
Is it possible to setWeights to define the relative sizes of colums in a
table? Also when I have added colums, there is a space to right hand side
that is undefined, how do I get the colums to absorb this space?]]>2005-10-28T04:16:26-00:00Re: SWT Table
https://www.eclipse.org/forums/index.php/mv/msg/147102/463171/#msg_463171
You could attach a resize listener to the table.
(The resize event occurs at table creation, too.)
This would be the only possibility to get rid of the blind extra column
and implent relative sizes.
> Is it possible to setWeights to define the relative sizes of colums in a
> table? Also when I have added colums, there is a space to right hand
> side that is undefined, how do I get the colums to absorb this space?
>]]>Yves Harms2005-10-28T13:01:14-00:00Re: SWT Table
https://www.eclipse.org/forums/index.php/mv/msg/147102/463183/#msg_463183
Originally posted by: davidyoung_2001.yahoo.co.uk
Thanks Yves - how do I find out the size of the composite area, so that I
can implement relative sizes?]]>2005-10-28T16:09:17-00:00Re: SWT Table
https://www.eclipse.org/forums/index.php/mv/msg/147102/463189/#msg_463189
Originally posted by: friederich.kupzog.de
Hi,
given your Table object is called table:
table.getSize().x gives you the width your columns can use.
Hope that helped,
Friederich
david young wrote:
> Thanks Yves - how do I find out the size of the composite area, so that
> I can implement relative sizes?
>
--
Friederich Kupzog
Elektronik & Software
Neusser Str. 5-7
50670 Köln
Tel 0241 160696-1
Fax 0221 726670
www.kupzog.de/fkmk]]>2005-10-28T22:46:41-00:00Re: SWT Table
https://www.eclipse.org/forums/index.php/mv/msg/147102/463197/#msg_463197
Daniel]]>Daniel Spiewak2005-10-29T19:11:58-00:00Re: SWT Table
https://www.eclipse.org/forums/index.php/mv/msg/147102/463205/#msg_463205
my antecessor already proposed some good advice on this topic. I just wanted to add another option to address this problem. I always handle it this way:
1) Define a default width for all table columns
2) Add the user option to resize all colums that way that they adopt the width of the widest cell by using <i>TableColumn.pack()</i>. Add an accelerator for this as done in windows explorer (ctrl + plus) for example.
I switched to this solution since it doesn't restrict the user so much. Experience taught me that many users do not want a table to auto resize as the enclosing component, e.g. the window is resized.