Project: SWT
Bug 82336 TreeView: setting gray gives free check mark
Reported: 2005-01-06 11:55:47 | Status: verified fixed

swt 20050106 Setting TreeItem.setGrayed (true) causes a check mark to show eventhough the item is uncheck. public static void main(String[] args) { display = new Display (); shell = new Shell (); shell.setLayout( new FillLayout ()); tree = new Tree (shell, SWT.CHECK | SWT.MULTI); item = new TreeItem (tree, SWT.NONE); item.setText("Text"); display.addFilter(SWT.KeyDown, new Listener() { public void handleEvent(Event event) { switch (event.character) { case '1': item.setGrayed(!item.getGrayed()); break; case '2': item.setChecked(!item.getChecked()); break; case '3': tree.setEnabled(!tree.getEnabled()); break; } } }); shell.open (); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep (); } } display.dispose (); } I don't know if gtk has icons to represent all the combinations swt needs (uncheck, check, uncheck+gray, check+gray). If not, I think we should make the uncheck+gray be the same as uncheck. This needs to be fixed in Tree and Table probably.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java