Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Tree (with Column's) height
Tree (with Column's) height [message #461688] Tue, 27 September 2005 09:32 Go to next message
Rajeev Sudra is currently offline Rajeev SudraFriend
Messages: 30
Registered: July 2009
Member
Dear all,

I have created a TreeViewer with two columns. I want to increase the
height of the rows (without changing the default font).

When it was TableTreeViewer, I would create a dummy image of the
appropriate size, add it explicitly as the first item to the underlying
TableTree and then dispose it.

Currently, I am doing the following for the Tree:

Image spacerImage = new Image(parent.getDisplay(), 20, 20);
TreeItem topItem = tree.getTopItem();
if (topItem != null) {
TreeItem item = new TreeItem(tree, SWT.NONE);
item.setImage(1, spacerImage);
item.dispose();
}

However, by adding the image to column 1, items in column 0 have an empty
space created where an image would go before the text even though there is
no image there. This looks very ugly - it is as if the images must be used
with all columns or not at all.

Is there another way of setting the row height for a TreeItem?

Thanks,
Raj
Re: Tree (with Column's) height [message #462011 is a reply to message #461688] Wed, 05 October 2005 01:35 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
This ugliness is Windows platform behavior.

"Rajeev Sudra" <rsudra@-nospam-hotmail.com> wrote in message
news:979b440d4a1c50f510ebd1448e7dcbef$1@www.eclipse.org...
> Dear all,
>
> I have created a TreeViewer with two columns. I want to increase the
> height of the rows (without changing the default font).
>
> When it was TableTreeViewer, I would create a dummy image of the
> appropriate size, add it explicitly as the first item to the underlying
> TableTree and then dispose it.
>
> Currently, I am doing the following for the Tree:
>
> Image spacerImage = new Image(parent.getDisplay(), 20, 20);
> TreeItem topItem = tree.getTopItem();
> if (topItem != null) {
> TreeItem item = new TreeItem(tree, SWT.NONE);
> item.setImage(1, spacerImage);
> item.dispose();
> }
>
> However, by adding the image to column 1, items in column 0 have an empty
> space created where an image would go before the text even though there is
> no image there. This looks very ugly - it is as if the images must be used
> with all columns or not at all.
>
> Is there another way of setting the row height for a TreeItem?
>
> Thanks,
> Raj
>
>
Previous Topic:Is this a SWT bug?
Next Topic:Text widget on Win98
Goto Forum:
  


Current Time: Mon Sep 28 07:15:28 GMT 2020

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

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

Back to the top