Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 81021 - Table Scroll bar does not fire correct event detail on Linux-GTK
Summary: Table Scroll bar does not fire correct event detail on Linux-GTK
Status: RESOLVED DUPLICATE of bug 51995
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-14 17:57 EST by Samantha Chan CLA
Modified: 2004-12-21 15:48 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samantha Chan CLA 2004-12-14 17:57:46 EST
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();
	}
Comment 1 Steve Northover CLA 2004-12-21 15:48:01 EST

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