[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: how to make a Table Column only contains image

Wayne, thanks a lot, I will give it a try!

Wayne Beaton wrote:
Try drawing the column yourself. You can draw the image anywhere in the
cell that you want to. There are examples of this in the swt/snippets
[1] page. Snippet230 [2] should point you in the right direction

HTH,

Wayne

[1]http://www.eclipse.org/swt/snippets
[2]http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%
7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet220.java

On Mon, 2008-06-09 at 18:10 -0500, Hongying Zhang wrote:
Hello,

I have a SWT table widget, I want one of the table column only contains an image. I did following:
TableItem tableItem = new TableItem( myTable, SWT.NONE );
tableItem.setImage( myImage );


By doing this, I run into a problem when user clicked on an image of this Table, there is a single space always appeared to be selected at right of the image. I tried to call myTable.setSelection(-1) at end of tableâs mouse up event, this help a little (The single selected space disappeared after mouse up), but I still see that single space selected during the click. I guess I missed something here. Can someone please let me know, how I can make a table column contains image and when selected, there is no space selected next to the image.

Thanks,
Hongying