|
Re: How to set a treeitem background or foreground [message #779804 is a reply to message #778905] |
Mon, 16 January 2012 15:36 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Listen on the MenuItem for a Selection event, example:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet131.java
..
Then change the Table/Tree item's color, example:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet129.java
.. This snippet is for TableItems, but doing it for TreeItems is identical.
Grant
On 1/13/2012 11:23 PM, Le Le wrote:
> Hi there,
>
> How to set a treeitem background or foreground based on a menuitem clicked?
>
> e.g. I have a treeitem called Project and right click Project it has two
> menu items, one is Activate, and one is Deactivate. When Activate
> clicked, I would like to have the Project background and foreground
> color set to different ones, when Deactivate clicked, the colors will
> return to original ones.
>
> Is there a way to do it? I am stuck for two days already..
>
> Thanks for your help and time!
>
> Lele
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03454 seconds