Problem with Tree under Windows [message #466126] |
Tue, 03 January 2006 09:43  |
Eclipse User |
|
|
|
Hi,
I have a TreeViewer and a Tree with a custom Content and LabelProvider.
The Tree itself is single selection with multiple columns, because i need
to edit single cells.
My problem - which occurs only on windows, neither on unix nor on mac - is
the following: When i attach a selectionlistener i always get the first
item in the tree from the event - no matter where in the tree i click.
when i use a mouselistener instead and try to retrieve the item via
tree.getItem(new Point(mouseEvent.x, mouseEvent.y)) i always get null if i
click somewhere else than in the first row.
The strange thing is that this works without any problem on unix and mac.
Does anybody have similar experiences or a workaround or know if this an
official bug (although i didn't find anything)??
By the way i use SWT 3.1.1
Thanks
Martin
|
|
|
Re: Problem with Tree under Windows [message #466321 is a reply to message #466126] |
Fri, 06 January 2006 10:28  |
Eclipse User |
|
|
|
Hi Martin,
Just same problem I encountered few days before.
You should new a tree like this:
Tree tree = new Tree (shell, SWT.BORDER | SWT.FULL_SELECTION);
SWT.FULL_SELECTION makes event fire when you click other columns.
- Yichao Easter
On Tue, 3 Jan 2006 14:43:09 +0000 (UTC), Martin@xxx.com (Martin)
wrote:
>Hi,
>
>I have a TreeViewer and a Tree with a custom Content and LabelProvider.
>The Tree itself is single selection with multiple columns, because i need
>to edit single cells.
>My problem - which occurs only on windows, neither on unix nor on mac - is
>the following: When i attach a selectionlistener i always get the first
>item in the tree from the event - no matter where in the tree i click.
>when i use a mouselistener instead and try to retrieve the item via
>tree.getItem(new Point(mouseEvent.x, mouseEvent.y)) i always get null if i
>click somewhere else than in the first row.
>
>The strange thing is that this works without any problem on unix and mac.
>Does anybody have similar experiences or a workaround or know if this an
>official bug (although i didn't find anything)??
>
>By the way i use SWT 3.1.1
>
>Thanks
>Martin
|
|
|
Powered by
FUDForum. Page generated in 0.14780 seconds