Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with Tree under Windows
Problem with Tree under Windows [message #466126] Tue, 03 January 2006 14:43 Go to next message
Martin is currently offline MartinFriend
Messages: 35
Registered: July 2009
Member
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 15:28 Go to previous message
Yichao Zhang is currently offline Yichao ZhangFriend
Messages: 7
Registered: July 2009
Junior Member
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
Previous Topic:how to put a image/icon into my composite instead of button
Next Topic:How to change the usual button look&feel to window xp button look&feel
Goto Forum:
  


Current Time: Thu Apr 25 04:41:10 GMT 2024

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

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

Back to the top