Project: SWT
Bug 148094 Control#setCapture() not working as expected
Reported: 2006-06-21 14:53:55 | Status: resolved fixed

Eclipse 3.2 According to the JavaDoc of Control#setCapture(), "causes the receiver to have all mouse events delivered to it until the method is called with false". See this snippet: public class Main { static Tree t; public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Button b = new Button(shell, SWT.NONE); b.addSelectionListener(new SelectionAdapter() { public void widgetDefaultSelected(SelectionEvent e) { t.setCapture(true); } }); t = new Tree(shell, SWT.NONE); for (int i = 0; i < 100; i++) { new TreeItem(t, SWT.None).setText("Hello World"); } shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } } Hitting the Button, I begin using my MouseWhell to scroll, but the Tree is not scrolling. From what the JavaDoc tells me, I had expected this behaviour. Since I more think that this is a platform-limitation than a bug in setCapture() , at least the JavaDoc should clarify what this API is about. Ben

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java