Community
Participate
Working Groups
I have a selection listener for the scrollbar from a table. When the scroll bar is moved on Windows, the detail of selection event received by the listener corresonds to what is being done by the user. i.e. If the user has scroll up or down, the event details will be set to "SWT.ARROW_UP" or "SWT.ARROW_DOWN" correspondingly. On Linux-GTK, the event detail is always assigned to zero. The event detail does not reflect what the user is doing with the scroll bar. Here's my testcase: public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setBounds(10,10,200,200); Table table = new Table(shell, SWT.NONE); table.setBounds(10,10,100,100); for (int i = 0; i < 99; i++) { new TableItem(table, SWT.NONE).setText("item " + i); } shell.open(); ScrollBar bar = table.getVerticalBar(); bar.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { System.out.println("Event Details: " + e.detail); } public void widgetDefaultSelected(SelectionEvent e) { }}); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
*** This bug has been marked as a duplicate of 51995 ***