Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Image size cannot be changed after first setImage in SWT Table using Win32
Image size cannot be changed after first setImage in SWT Table using Win32 [message #461130] Fri, 16 September 2005 16:57
Bill is currently offline BillFriend
Messages: 8
Registered: July 2009
Junior Member
We wanted to make a table look like Excel. We put an image in the first
column with a row number drawn into it.

This all worked great until we resized the column. What we found was that
no matter what, any image we tried to set was the same width as the
original image.

I posted here and was roundly scolded with something like "SWT is not
Excel so stop trying to make it so."

Frustrated that I could not get help here, I turned to one of the authors
of what many would agree is the best book on SWT and JFace

This person, studied the problem and confirmed it:

"I played with this awhile, and it appears, as far as I can tell, that
you’ve run into a bug—one that appears to be on the Windows side,
actually, although I haven’t had a chance to test on Linux or Mac OS X.
When you call TableItem.setImage(), it calls TableItem.redraw(), which
then calls TableItem.getBounds() to determine the area in which to draw.
TableItem.getBounds sends the Windows message LVM_GETSUBITEMRECT to the
Table, which is actually a Windows ListView control. The resulting RECT
returned always contains the original width, at least on my machine. So,
your code thinks the image is one size (the column width), but when SWT
sizes the image to draw it in the table cell it always draws it with the
original width."

Short on time and having misplaced my bugzilla name/password, could
someone help out by advising if this has already been reported or should

Even if it is a Windows problem that SWT cannot overcome (like the first
column always being left justified), wouldn't it make sense to log the bug
Previous Topic:How do I implement this dialog behavior?
Next Topic:Tree lines
Goto Forum:

Current Time: Mon Sep 23 11:11:03 GMT 2019

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

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

Back to the top