Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 55579 - GTK: Slider selection events have wrong detail (BBAWT)
Summary: GTK: Slider selection events have wrong detail (BBAWT)
Status: RESOLVED DUPLICATE of bug 51995
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-22 14:39 EST by David Whiteman CLA
Modified: 2004-03-22 15:40 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Whiteman CLA 2004-03-22 14:39:25 EST
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();
			}
		}

	}
}
Comment 1 Felipe Heidrich CLA 2004-03-22 15:40:04 EST

*** This bug has been marked as a duplicate of 51995 ***