|
Re: Setting Table row height [message #447319 is a reply to message #447312] |
Mon, 13 December 2004 17:34 |
Mani Ghamari Messages: 33 Registered: July 2009 |
Member |
|
|
There is no built-in way of doing this in SWT, as far as I know.
The only possible (and very dirty) workaround I can think of is through
setting an image for the table. And forcing the height through setting the
height of the image (The TableITems height is made long enough to fit the
height of the image).
(having a look at the API docs, another possible way of doing it might be
through using a TableEditor and setting the miminumHeight field, yet I
personally have no experince with TableEditor and therefore can not confirm
this statement)
The following sample code should illusteate the solution using an image:
int height = 50;
TableItem item = table.getItem(0);
Image fake = new Image(table.getDisplay(), 1, height);
item.setImage(0, fake);
make sure to dispose of the fake image when the Table/TableItem is
disposed...
(I tested this sample under WinXP/SWT 3063 with success, yet you might also
require to fill the fake image with the table's background color on other
platforms?)
regards,
Mani
"Chris Audley" <chris.audley@beacon-cs.com> wrote in message
news:cpkg2n$11d$1@www.eclipse.org...
> How do I modify the height of a row in an SWT row? I have a table where I
> try and change the font to a larger size in some of the columns, but the
> table rows do not grow to accomodate the larger text. I haven't been able
> to find a method in the Table/TableItem classes that would set the height
> of the table rows, how can I accomplish this?
>
> Chris
|
|
|
Powered by
FUDForum. Page generated in 0.02714 seconds