Community
Participate
Working Groups
Build Identifier: 1.3.2.20110218-0812 If the Table background is set to be different from the cell background color, you'll notice that there's a 1-2px crack between two cells that are not filled with the cell background color, but instead shows the Table Background. It looks good in XP: <img src="http://i.stack.imgur.com/1hOyX.png" /> But bad in W7: <img src="http://i.stack.imgur.com/rReum.png" /> If I use an SWT jar from 3-4 jars ago, the problem goes away, so it's not a Windows 7 native rendering problem, but rather some bug in the new SWT jars with how it interacts with Windows 7. Reproducible: Always Steps to Reproduce: 1. Create a Shell 2. Create a Table in the Shell. Set background to back 3. Create a couple of TableItems and color all cell's background to Light Blue 4. Observer the dark column dividing black lines between columns
How come nobody is looking into this? Or at least comment on it? Is SWT an abandoned child?
Please add a testcase, I will take a look at this problem when I return from vacation (next week). Thanks
Table items look perfectly white and clean in XP. columns appear to be separated by a thick black line under Windows 7. Test Code to reproduce: import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; public class W7TableTest { Display d; Shell s; W7TableTest() { d = new Display(); s = new Shell(d); s.setSize(250, 200); s.setText("A Table Shell Example"); s.setLayout(new FillLayout()); final Table t = new Table(s, SWT.FULL_SELECTION | SWT.VIRTUAL); final TableColumn tc1 = new TableColumn(t, SWT.CENTER); final TableColumn tc2 = new TableColumn(t, SWT.CENTER); final TableColumn tc3 = new TableColumn(t, SWT.CENTER); tc1.setText("First Name"); tc2.setText("Last Name"); tc3.setText("Address"); tc1.setWidth(70); tc2.setWidth(70); tc3.setWidth(80); t.setHeaderVisible(true); final TableItem item1 = new TableItem(t, SWT.NONE); item1.setText(new String[] { "Tim", "Hatton", "Kentucky" }); final TableItem item2 = new TableItem(t, SWT.NONE); item2.setText(new String[] { "Caitlyn", "Warner", "Ohio" }); final TableItem item3 = new TableItem(t, SWT.NONE); item3.setText(new String[] { "Reese", "Miller", "Ohio" }); final org.eclipse.swt.graphics.Color black = new org.eclipse.swt.graphics.Color(d, 0, 0, 0); final org.eclipse.swt.graphics.Color white = new org.eclipse.swt.graphics.Color(d, 255, 255, 255); item1.setBackground(white); item2.setBackground(white); item3.setBackground(white); t.setBackground(black); s.open(); while (!s.isDisposed()) { if (!d.readAndDispatch()) { d.sleep(); } } d.dispose(); } public static void main(final String[] argv) { new W7TableTest(); } }
Any assessment, please? Thank you.
(In reply to comment #4) > Any assessment, please? Thank you. Sorry, not sure we can change it. It is Windows that changed the native behaviour of the control to draw the table cell this way. If you need to overwrite the way the control draws you need to use custom draw, see http://www.eclipse.org/swt/snippets/#table and check th snippets that talk have the word "custom" in the description. Note that is a behaviour that changed in Windows not in SWT, (I don't believe that I can fight Windows Seven to render a la XP...)
It sounds like the older version of SWT does not exhibit this behavior in Win7 - doesn't that imply that there should be some way to make it work? Thanks
> If you need to overwrite the way the control draws you need to use custom draw, > see http://www.eclipse.org/swt/snippets/#table and check th snippets that talk > have the word "custom" in the description. Also it is worth noting, that in the past, I have tried to deal with rendering issues using custom listeners (paintItem/eraseItem/measureItem, etc), and the simple act of adding a listener (even with no code in it) introduced performance degradation - so ideally something as basic as this would be achievable without "custom" logic.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.