|neither paintItem nor paintListener working well for rendering in my table [message #702423]
||Tue, 26 July 2011 11:06
| Mark Fishman
Registered: March 2011
I have a large, virtual table (50 columns by 1000's of rows) on a windows platform and I am trying to setup one of the columns such that that column can display multiple images in its cells.|
My first attempt to accomplish this goal was to add a listener for SWT.paintItem events and use GC to draw the images in the cell. This approach, for the most part, worked pretty well. Unfortunately, the one issue I found was that performance had degraded when I tried to scroll the table using its scroll bar. What had been a smooth scroll that had kept up with the drag gesture had become jerky and with lag. My initial assumption was that the problem was with my draw logic but I changed the body of the handleEvent method to have no logic in it all (i.e. be a NOP) and I still had performance issues.
With paintItem seeming to have problems, I then fell back and attempted to use paintListener instead. I did an addPaintListener() to the table and had the listener just draw the icons for all of the currently visible rows. The performance using this approach is great and fixed my scrolling issues but, unfortunately, it introduced a new one. Now, when I drag the scrollbar the icons flicker.
Can anyone give me any tricks or suggestions? Is there a better approach than the two I tried or is there anything I can do in either of these approaches to resolve the issues that I am seeing with them?
Powered by FUDForum
. Page generated in 0.02050 seconds