Hi all,
I attached a listener to the Shell on SWT.MouseUp and SWT.MouseDown events, but the handleEvent method never gets fired. I tried clicking at many places on the window, but it doesn't get even to the System.out.println(..) in the code below...
Do you spot any error here?
Thank you!
//c is a Composite.
final Listener l = new Listener(){
public void handleEvent(Event event) {
System.out.println("Got event. "+event);
Rectangle rect = c.getBounds();
if (rect.contains(event.x, event.y)){
if((Boolean)c.getData("selected")){
c.setData("selected", Boolean.FALSE);
}else{
c.setData("selected", Boolean.TRUE);
}
}
}
};
c.getShell().addListener(SWT.MouseUp, l);
c.getShell().addListener(SWT.MouseDown, l);
(This composite is inside an Eclipse editor that uses the Forms Toolkit)
Regards,
-Pradyumna