Community
Participate
Working Groups
Build Identifier: 20110916-0149 The Slider widget in the example program for SWt Slider( copied below) is not visible in Ubuntu 11.10 with Overlay Scrollbars enabled. A workaround is to disable the Overlay Scrollbars by following the steps in http://www.webupd8.org/2011/04/how-to-disable-overlay-scrollbars-in.html : sudo su echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars SWT Slider Example code copied from http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTSliders.htm /* * Created on Nov 17, 2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ import org.eclipse.swt.SWT; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Slider; import org.eclipse.swt.widgets.Text; /** * @author Steven Holzner * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class SWTSliders { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display, SWT.RESIZE); shell.setText("Sliders"); shell.setSize(300, 200); final Label label = new Label(shell, SWT.NONE); label.setText("Move the slider"); label.setBounds(0, 20, 150, 15); final Slider slider = new Slider(shell, SWT.HORIZONTAL); slider.setBounds(0, 40, 200, 20); final Text text = new Text(shell, SWT.BORDER); text.setBounds(0, 100, 200, 25); slider.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { String outString = "Event: SWT.NONE"; switch (event.detail) { case SWT.ARROW_DOWN: outString = "Event: SWT.ARROW_DOWN"; break; case SWT.ARROW_UP: outString = "Event: SWT.ARROW_UP"; break; case SWT.DRAG: outString = "Event: SWT.DRAG"; break; case SWT.END: outString = "Event: SWT.END"; break; case SWT.HOME: outString = "Event: SWT.HOME"; break; case SWT.PAGE_DOWN: outString = "Event: SWT.PAGE_DOWN"; break; case SWT.PAGE_UP: outString = "Event: SWT.PAGE_UP"; break; } outString += " Position: " + slider.getSelection(); text.setText(outString); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } Reproducible: Always Steps to Reproduce: 1.Run the SWt Slider program listed at http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTSliders.htm on Ubuntu 11.10 with Overlay Scrollbars enabled (default) 2. Slider is not visible 3.
Arun, please try this.
I tested the example with Eclipse 3.8 M3 build I20110912-2126 and 4.2 M5 build I20120127-1145 on Ubuntu 11.04 which has overlay scrollbars enabled and it worked as expected for me. Are you using Unity or GNOME desktop on Ubuntu 11.10? Can you check whether the behavior differs between the two?
I am using Gnome 3 shell rather than Unity
Created attachment 225979 [details] Screenshot of snippet window Attaching screenshot of how the window looks on my system. This is Ubuntu 12.04 with Unity on a standard VMware guest. Instead of sliders I get two large empty areas. (Setting LIBOVERLAY_SCROLLBAR=0 helps on this system)
*** Bug 399564 has been marked as a duplicate of this bug. ***
Confirmed on Ubuntu 12.04 with latest SWT and SWT's Snippet17. Perhaps we should reconsided using GtkScrollbar for a slider? Does this work better in GTK3? Is there an alternative control that might be a more natural choice in GTK3?
I have a proposed patch for a bug with overlay scrollbars in TMF (bug 384763) and it looks like it fixes this bug too: https://bugs.launchpad.net/bugs/1188831
Ubuntu is moving away from their own overlay scrollbars and Eclipse disables them by default nice Eclipse 4.4. Additionally, the right fix would be done on the Ubuntu side, see https://bugs.launchpad.net/bugs/1188831.