Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] find a table cell from mouse down

"find a table cell from mouse down"

The algorithm in the snippets only works when you create the table with
SWT.FULL_SELECTION. That wouldn't be so much of a problem if you could
change the colour of the selection bar and give it the background colour.
But such method seems not to be available?

				Point pt = new Point (event.x, event.y);
                        TableItem item = table.getItem (pt);
                        if (item == null) return;
                        for (int i=0; i < columnCount; i++) {
                                Rectangle rect = item.getBounds (i);
                                if (rect.contains (pt)) return i;
                        }




Back to the top