Bug 51995 - SelectionEvent not getting detail info for scrollbar events
Summary: SelectionEvent not getting detail info for scrollbar events
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.2 M1   Edit
Assignee: Billy Biggs CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 21464 55579 78561 81021 102921 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-13 15:18 EST by Greg Dean CLA
Modified: 2005-07-22 10:57 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Dean CLA 2004-02-13 15:18:26 EST
I have a Canvas where I am using scrollbars. I've added a SelectionListener to
the scrollbars and everything works fine under Windows and the Motif version on
Linux. My problem is that under the GTK version on Linux the detail member of
the SelectionEvent is always 0 and so I don't know whether its a up, down,
pageup, pagedown, or drag.
Comment 1 Grant Gayed CLA 2004-02-13 16:12:54 EST
still happens in 3.0, snippet:

public static void main(String[] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setBounds(10,10,200,200);
	Canvas canvas = new Canvas (shell, SWT.V_SCROLL | SWT.BORDER);
	canvas.setBounds(10,10,100,100);
	shell.open();
	canvas.getVerticalBar().addSelectionListener(new SelectionListener() {
		public void widgetSelected(SelectionEvent e) {
			System.out.println(e.detail);
		}
		public void widgetDefaultSelected(SelectionEvent e) {}
	});
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
Comment 2 Felipe Heidrich CLA 2004-03-22 15:39:19 EST
There is GTK bug for this problem:
http://bugzilla.gnome.org/show_bug.cgi?id=133263
Comment 3 Felipe Heidrich CLA 2004-03-22 15:40:05 EST
*** Bug 55579 has been marked as a duplicate of this bug. ***
Comment 4 Veronika Irvine CLA 2004-08-27 11:50:40 EDT
This GTK bug has now been fixed (target 2.6)

See:
http://bugzilla.gnome.org/show_bug.cgi?id=133263
Comment 5 Grant Gayed CLA 2004-11-30 09:12:53 EST
*** Bug 78561 has been marked as a duplicate of this bug. ***
Comment 6 Grant Gayed CLA 2004-11-30 09:14:56 EST
as a reminder, Slider and Scale are affected similarly
Comment 7 Steve Northover CLA 2004-12-21 15:48:02 EST
*** Bug 81021 has been marked as a duplicate of this bug. ***
Comment 8 Steve Northover CLA 2004-12-21 15:49:08 EST
BB, you have 2.6, let's fix this thing.
Comment 9 Billy Biggs CLA 2005-02-12 12:56:16 EST
It's a little more complicated than I would like.  The API was added to
scrollbars, but not to adjustments.  There is no API to get the scrollbars from
a scrolled window except by looking in the structure itself, and it is not clear
to me whether this is public API.

  http://bugzilla.gnome.org/show_bug.cgi?id=167181

Implementing this for Slider and Scaler is no problem, since we create the range
objects ourselves.
Comment 10 Billy Biggs CLA 2005-05-29 14:33:43 EDT
*** Bug 21464 has been marked as a duplicate of this bug. ***
Comment 11 Billy Biggs CLA 2005-07-06 15:46:48 EDT
*** Bug 102921 has been marked as a duplicate of this bug. ***
Comment 12 DC CLA 2005-07-06 16:13:06 EDT
I saw your reply on the bug(duplicate), I filed ...

Carrying forward the conversation from there, is it possible for you to give 
me a rough-estimate when we may get a fixed version ?

Thanks ! 
Comment 13 Billy Biggs CLA 2005-07-07 11:18:28 EDT
Fixed > 20050707 in HEAD for ScrollBar, Slider and Scale.  The detail will be
correctly reported if you are using GTK+ 2.6.0 or newer.
Comment 14 Billy Biggs CLA 2005-07-22 10:57:49 EDT
*** Bug 104779 has been marked as a duplicate of this bug. ***