Project: SWT
Bug 95825 GTK warnings when using a virtual table
Reported: 2005-05-18 14:51:54 | Status: resolved fixed

0517 Red Hat Enterprise 3.0 When I run the example below I get the following warnings to the console. If the table does not have the VIRTUAL flag set I get no error. (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed (<unknown>:6925): Gtk-CRITICAL **: file gtktreeview.c: line 10200 (gtk_tree_view_get_cell_area): assertion `GTK_WIDGET_REALIZED (tree_view)' failed import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; public class SimplePhantomRowsTest { static boolean showAll = true; /** * @param args */ public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display, SWT.CLOSE); shell.setLayout(new GridLayout(1, false)); Button button = new Button(shell, SWT.TOGGLE); button.setText("Toggle"); final TableViewer table = new TableViewer(shell, SWT.VIRTUAL); table.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); table.getTable().setLinesVisible(true); table.setContentProvider(new IStructuredContentProvider() { public Object[] getElements(Object inputElement) { String[] result = new String[itemSize()]; for (int i = 0; i < result.length; i++) { result[i] = "Element " + String.valueOf(i); } return result; } public void dispose() { // TODO Auto-generated method stub } public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // TODO Auto-generated method stub } }); table.setLabelProvider(new LabelProvider() { public String getText(Object element) { return (String) element; }; }); table.setInput(table); table.setItemCount(15); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { showAll = !showAll; table.getTable().setItemCount(itemSize()); table.refresh(); } }); shell.setSize(300, 400); shell.open(); while (!shell.isDisposed()) { display.readAndDispatch(); } } static protected int itemSize() { if (showAll) return 15; return 5; } }

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