Tree (with Column's) height [message #461688] |
Tue, 27 September 2005 09:32 |
Rajeev Sudra 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 |
Steve Northover 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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03472 seconds