Project: SWT
Bug 175707 removing MeasureItem listener and clearing items inverts table
Reported: 2007-02-27 10:11:46 | Status: resolved fixed

- run the snippet below and push the button public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display); shell.setBounds(10, 10, 220, 290); shell.setLayout(new GridLayout()); final Table table = new Table(shell, SWT.NONE); table.setLinesVisible(true); final Listener listener = new Listener() { public void handleEvent(Event event) {} // I do nothing }; table.addListener(SWT.MeasureItem, listener); Button button = new Button(shell, SWT.PUSH); button.setText("Push"); button.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { table.removeListener(SWT.MeasureItem, listener); table.removeAll(); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java