Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Setting Table row height
Setting Table row height [message #447312] Mon, 13 December 2004 16:30 Go to next message
Chris Audley is currently offline Chris AudleyFriend
Messages: 41
Registered: July 2009
Member
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
Re: Setting Table row height [message #447319 is a reply to message #447312] Mon, 13 December 2004 17:34 Go to previous message
Mani Ghamari is currently offline Mani GhamariFriend
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
Previous Topic:Complex table design
Next Topic:PaintEvent question
Goto Forum:
  


Current Time: Wed Oct 28 05:29:21 GMT 2020

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

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

Back to the top