MouseHover and Tooltip question [message #441204] |
Thu, 12 August 2004 03:34 |
Eclipse User |
|
|
|
Originally posted by: trevor.campbell.kaz.com.au
Is it OK to set a tooltip value inside a mouseHover event?
I have the following code to show a tip when the mouse hovers over a
particular place on a map painted on an org.eclipse.swt.widgets.Canvas.
_canvas.addMouseTrackListener(new MouseTrackAdapter() {
public void mouseHover(MouseEvent e) {
_canvas.setToolTipText(""); //I've also tried null here;
for (Iterator iter = _wayPoints.keySet().iterator();
iter.hasNext();) {
Point p = (Point) iter.next();
if (Math.abs(p.x - e.x) < 5 && Math.abs(p.y - e.y) <
5) {
Waypoint wp = (Waypoint) _wayPoints.get(p);
_canvas.setToolTipText(wp.getName());
break;
}
}
}
});
This works well in Windows, but not in Linux/GTK.
I'm not sure if what I'm doing is legal or if it's a bug in SWT/GTK
Trev
|
|
|
|
Re: MouseHover and Tooltip question [message #441629 is a reply to message #441211] |
Wed, 18 August 2004 01:39 |
Eclipse User |
|
|
|
Originally posted by: trevor.campbell.kaz.com.au
varname wrote:
> what's the actual problem? Are you getting invalid access exceptions or does
> it 'just not work'?
It just doesn't work. Vary rarely a tooltip will pop up but not in the
right spot, the rest of the time I see no tip at all.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02816 seconds