Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Tree/TreeViewer: How to detect a click into the icon without selecting the TreeItem
Tree/TreeViewer: How to detect a click into the icon without selecting the TreeItem [message #546555] Tue, 13 July 2010 07:16 Go to next message
Eclipse UserFriend
Hello,

I have a SWT Tree and use a MouseListener to detect clicks into the icons of individual TreeItems.

First, is there a better way than to use a MouseListener to detect icon clicks?

Second, is there a way, to detect clicks on a TreeItem's icon without having it automatically selected (I tried with event.doit and similar stuff, without an effect)?

Thanks,
/Stefan
Re: Tree/TreeViewer: How to detect a click into the icon without selecting the TreeItem [message #547105 is a reply to message #546555] Thu, 15 July 2010 10:28 Go to previous message
Eclipse UserFriend
> First, is there a better way than to use a MouseListener to detect icon
> clicks?

No, this is the way to do it.

> Second, is there a way, to detect clicks on a TreeItem's icon without
> having it automatically selected (I tried with event.doit and similar
> stuff, without an effect)?

Not specifically, but you can remember that the item's image was clicked and
then remove the item from the selection. For an example of filtering item
selections see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet80.java?view=co .
I've tried this snippet on win32, gtk, and cocoa, and none of them show any
selection flash when selecting-then-deselecting an item.

HTH,
Grant
Previous Topic:Issues with SWT 3.5 and Solaris (Sparc)
Next Topic:Specifying Mozilla Version for SWT Browser
Goto Forum:
  


Current Time: Sun Jul 13 09:38:43 EDT 2025

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

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

Back to the top