Project: SWT
Bug 90246 StyledText draws cheesy if the caret is invisible
Reported: 2005-04-04 21:40:34 | Status: resolved fixed

I am trying to disable drawing of the caret in a StyledText widget. Run the following example and click around, the cursor will be cheesily drawn as you click around or rapidly select text with the mouse: public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); StyledText text = new StyledText(shell, SWT.READ_ONLY); text.setText("This is some text\nThis is some text\n" + "This is some more text blah blah blah"); text.getCaret().setVisible(false); shell.open(); while(!shell.isDisposed()) { if(!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Caret.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Caret.java bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Caret.java