Bug 83833 - [consistency] selection event fired on scrollbars when using setTopIndex
Summary: [consistency] selection event fired on scrollbars when using setTopIndex
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux-GTK
: P3 minor (vote)
Target Milestone: 4.7   Edit
Assignee: Ian Pun CLA
QA Contact:
URL:
Whiteboard:
Keywords: consistency
Depends on:
Blocks:
 
Reported: 2005-01-27 10:24 EST by Billy Biggs CLA
Modified: 2016-08-11 11:40 EDT (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 Billy Biggs CLA 2005-01-27 10:24:26 EST
On Linux, a selection event is received by this scrollbar.  None is received on
win32.

public static void main(String [] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	Table table = new Table(shell, SWT.NONE);
	ScrollBar scrollBar = table.getVerticalBar();
	scrollBar.addSelectionListener(new SelectionListener() {
		public void widgetDefaultSelected(SelectionEvent e) {}
		public void widgetSelected(SelectionEvent e) {
			System.out.println("Selection event");
		}
	});
	for(int i = 0; i < 500; i++) {
		TableItem item = new TableItem(table, SWT.NONE);
		item.setText(0, "This is item " + i);
	}
	table.setTopIndex(20);
	shell.open();
	while(display.readAndDispatch());
	display.dispose();
}
Comment 1 Eric Williams CLA 2016-08-05 08:51:10 EDT
This is still reproducible, not sure how important it is bug still reproducible none the less.
Comment 2 Ian Pun CLA 2016-08-11 11:40:57 EDT
The use of gtk_tree_view_scroll_to_cell() in GTK3 is actually selecting the scrollbar in order to get to the cell, causing the selection event to be received by the scrollbar. I haven't been able to find a viable solution to block the scrollbar widget signals considering its being triggered from the Table widget. Also, I don't believe its likely someone is bump into use case, considering its been 11 years with no updates.