Project: SWT
Bug 146575 setCursor is ignored in the SWT Text under gtk-linux
Reported: 2006-06-12 10:33:38 | Status: resolved fixed

The cursor in the swt text field is always the standard cursor, calls to setCursor with a different cursor don't show any effect. It works under Windows; following example program shows the difference on the gtk-linux platform: import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Cursor; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.*; public class CursorTest { public static void main(String[] args) { Display display = new Display (); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Text text = new Text(shell, SWT.NONE); text.setText("this is a text"); text.setCursor(new Cursor(display, SWT.CURSOR_HAND)); Label label = new Label(shell, SWT.NONE); label.setText("this is a label"); label.setCursor(new Cursor(display, SWT.CURSOR_HAND)); shell.pack (); shell.open (); while (!shell.isDisposed()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } } While the mouse cursor changes when it is over the label, it is not the correct cursor, when the mouse is over the text field.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java