Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Is there a way to remove the blank tree icon inserted when other tree nodes have an icon?
Is there a way to remove the blank tree icon inserted when other tree nodes have an icon? [message #555712] Fri, 27 August 2010 14:41 Go to next message
Eclipse UserFriend
I want to create a tree 3 levels deep with the nodes at the first 2 levels
using no icons (so that the label text is as close as possible to the tree
expand icon) and the nodes at level 3 using icons. Does anyone know if this
is possible? Thanks.
Re: Is there a way to remove the blank tree icon inserted when other tree nodes have an icon? [message #555947 is a reply to message #555712] Mon, 30 August 2010 07:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

You can do this using custom drawing. You can draw the image and the text for the TreeItems at level 3 in the PaintItem Listener (instead of setting the image to the TreeItem). And use EraseItem Listener to prevent the default text drawing.

Please see the example snippets on how to use the PaintItem and EraseItem Listener --
Snippet220
Snippet227

Also useful - Article on Custom drawing Tree and TableItems
Re: Is there a way to remove the blank tree icon inserted when other tree nodes have an icon? [message #557083 is a reply to message #555947] Sat, 04 September 2010 00:51 Go to previous message
Eclipse UserFriend
Thanks this was exactly what I needed.
Previous Topic:Min size of a component? layout question
Next Topic:JavaDocs
Goto Forum:
  


Current Time: Sat Jul 12 13:58:30 EDT 2025

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

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

Back to the top