Community
Participate
Working Groups
If a table cell is too short or a tree cell wider than the visible area, Windows draws a "tooltip" for the whole content. Side note: a selected cell is drawn unselected. From the flags that are passed to the EraseItem or PaintItem event listener it is not clear at all whether the cell is painted in the tree/table or in the tooltip/overlay. My request is to add such a flag.
I ran into this in the EGit StagingView recently. See [1]. My findings were that the GC in the paint listener is clipped when drawing in the table, and is not clipped when drawing in that native hover. So I used tree.addListener(SWT.PaintItem, event -> { boolean inHover = !event.gc.isClipped(); // Do whatever needs to be done, depending on inHover } [1] https://git.eclipse.org/r/c/egit/egit/+/182394
Hi Thomas, Thanks for this hint. It looks like this rollover tooltip only exists on Windows, so it probably makes not much sense to implement that globally.
On OS X there is such a hover, too.
Err, you are right. I was not waiting long enough.