Community
Participate
Working Groups
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.
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(); }
There is GTK bug for this problem: http://bugzilla.gnome.org/show_bug.cgi?id=133263
*** Bug 55579 has been marked as a duplicate of this bug. ***
This GTK bug has now been fixed (target 2.6) See: http://bugzilla.gnome.org/show_bug.cgi?id=133263
*** Bug 78561 has been marked as a duplicate of this bug. ***
as a reminder, Slider and Scale are affected similarly
*** Bug 81021 has been marked as a duplicate of this bug. ***
BB, you have 2.6, let's fix this thing.
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.
*** Bug 21464 has been marked as a duplicate of this bug. ***
*** Bug 102921 has been marked as a duplicate of this bug. ***
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 !
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.
*** Bug 104779 has been marked as a duplicate of this bug. ***