Is it possible to have an SWT tree with lines of different height ?
Manuel
Is it possible to have an SWT tree with lines of different height ?
Manuel
Well, you could of course call setFont()
on the TreeItem
in question, and give it a larger font than that used by the other TreeItem
rows. However, this may not be what you want... having multiple font sizes in the Tree
.
A second more hack-y alternative might be to instead use the setImage()
method on TreeItem
... setting a white (or whatever) background image for each row, with the taller rows using a bigger image than the shorter rows.
This second approach would give you custom row heights without changing the fonts, although you would want to be sure to choose a background image of the same color as the system default background color. Perhaps you could even create your Image
objects programmatically in-memory to ensure this.
In a SWT tree or table the items cannot different heights. If you need to make every row with different height, you must use a custom widget, like KTable or nebula grid for example.