Forums Register Login

SWT -> TabItem -> addListener

+Pie Number of slices to send: Send
Hi,

I am trying to implement dnd from a table to different tabItems in a TabFolder, when the mouse enters a tabItem, i want the tabItem to get selected (brought to front) so that the draged item can be dropped in the tabItem. Basically I need to receive an event when the mouse enter or hovers over a tabItem ...

I tried tabitem.addListener(SWT.MouseEnter, new Listener() { ...
but it does not seem to work.

Does anybody have any suggestions ?

regards
Daniel
+Pie Number of slices to send: Send
Found the following solution :

folder.addMouseMoveListener(new MouseMoveListener() {
public void mouseMove(MouseEvent arg0) {
Point point = new Point(arg0.x, arg0.y);
TabItem[] items = folder.getItems();
for (int i = 0; i < items.length;i++) {
if (items[i].getBounds().contains(point)){
lineFolder.setSelection(items[i]);
}
}
}
});

Anyone have a better solution ?
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 5599 times.
Similar Threads
detecting mouse motion
Handle Stylus Event
SWT TabFolder related
How To Provide A Text When the Mouse Is Over An Image?
Relative Mouse coordinates
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:18:03.