Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » neither paintItem nor paintListener working well for rendering in my table(I am having issues when I try to use paintItem or paintListener to draw multiple images in table cells)
neither paintItem nor paintListener working well for rendering in my table [message #702423] Tue, 26 July 2011 11:06
Mark Fishman is currently offline Mark FishmanFriend
Messages: 27
Registered: March 2011
Junior Member
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?


-- Mark
Previous Topic:no scrollbars when expanding section with managedform.reflow()
Next Topic:Change the font size when resizing windows
Goto Forum:

Current Time: Sun Nov 29 23:36:33 GMT 2020

Powered by FUDForum. Page generated in 0.01895 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top