[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Table/TableEditor flicker problem - 3.2.1 on GTK2

The snippet below works fine on Windows XP, but flickers quite a bit (to the point of being unusable on Linux/GTK2).

Any ideas, or should I file a bug?

Also, my real objective here is to embed a Link within a table item. I have been having JFace TableViewer which was working fine, but I could not get the Link working with it. I tried to make a custom CellEditor (extending the abstract CellEditor class), but it did not seem to get invoked properly to create my custom control.

Any ideas on the best way to proceed in putting a link in a table?

Thanks,

Francis

----------------------------



package org.eclipse.swt.snippets;

import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;

public class Snippet126Flicker {
public static void main(String[] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
	shell.setLayout (new GridLayout ());
	Table table = new Table (shell, SWT.BORDER | SWT.MULTI);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 200;
    gd.widthHint = 200;
    table.setLayoutData(gd);

    TableColumn column = new TableColumn(table, SWT.NONE);
	column.setWidth (100);
	for (int i=0; i<100; i++) {
		new TableItem (table, SWT.NONE);
	}
	TableItem [] items = table.getItems ();
	for (int i=0; i<items.length; i++) {
		TableEditor editor = new TableEditor (table);
		editor = new TableEditor (table);
		Text text = new Text (table, SWT.NONE);
		text.setText("Text" + i);
		editor.grabHorizontal = true;
		editor.setEditor(text, items[i], 0);
		editor = new TableEditor (table);
	}
	shell.pack ();
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
}