amir farah
amir farah

Reputation: 41

Change eclipse menuitem color

I would like to change some menuitems color ,for example yellow, dynamically with my plugin. is it possible?

More details:
Lets say I wanna change the file->import menuitem to yellow, which class is responsible for that?
For simpleness, if I got SWT window, calculater with File menu in it, how to change the File->exit menuItem to yellow when I press or do something in this calculator windows??
thanks in advance

Upvotes: 1

Views: 1337

Answers (1)

VonC
VonC

Reputation: 1324218

Any menu-related color settings are OS-dependent, since SWT is based on native GUI implementation (as Kos alludes to in the comment).

This thread asks for the "inactive color":

I don't think there's a SWT.COLOR_... available for disabled menu texts, it's the OSs that colors these texts.
I don't know if the OSs provide a way for accessing this color programmatically.

This thread want to add color to a popup menu, and the best solution is...

I think your best bet is #2, that way you could put (for instance) a Table widget with no columns in the pop-up, which would allow you customize the item appearances however you like.

alt text

Upvotes: 1

Related Questions