Community
Participate
Working Groups
With the following testcase on Linux-GTK, I don't get any of the correct event detail values. This test works fine on win32; it never gets to the line where the selection is printed on GTK. SWT v3043b RH Linux 8.0, GTK 2.0.6. --- testcase --- import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.*; public class TestSWTSliderValueChanged { public static void main(String[] args) { final Display disp = Display.getDefault(); Shell shell = new Shell(disp); shell.setLayout(new FillLayout(SWT.VERTICAL)); final Slider slider = new Slider(shell, SWT.HORIZONTAL); slider.setMaximum(50); slider.setMinimum(0); slider.setThumb(20); slider.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { System.out.println("New value = "+slider.getSelection()); String type = ""; switch (e.detail) { case SWT.PAGE_UP: type = "page up"; break; case SWT.PAGE_DOWN: type = "page down"; break; case SWT.ARROW_UP: type = "arrow up"; break; case SWT.ARROW_DOWN: type = "arrow down"; break; case SWT.DRAG: type = "drag"; break; default: return; } System.out.println("Slider adjustment type = "+type); } }); shell.setText("Slider Test"); shell.setSize(200, 200); shell.setLocation(0, 0); shell.open(); while (!shell.isDisposed()) { if (!disp.readAndDispatch()) { disp.sleep(); } } } }
*** This bug has been marked as a duplicate of 51995 ***