改变日食menuitem颜色 [英] Change eclipse menuitem color
问题描述
我想使用我的插件动态更改一些 menuitems
颜色,例如黄色。
是可能吗?更多细节:
说我想改变 file-> import menuitem
为黄色,哪个类负责?
为了简单起见,如果我有SWT窗口,计算器与其中的File菜单,如何更改 File-> exit menuItem
黄色当我按下或在这个计算器窗口中做某事?
提前感谢
任何与菜单相关的颜色设置都是依赖于操作系统的,因为SWT是基于本地GUI实现(如 Kos 暗示在评论中)。
这个线程请求非活动颜色:
我不认为有一个
SWT.COLOR _...
可用于禁用的菜单文本,这是这些文本的操作系统。
我不知道是否t他的操作系统提供了以编程方式访问这种颜色的方法。
这个线程想添加颜色到弹出菜单,最好的解决方案是...
我认为你最好的选择是#2,这样你可以把(例如)一个Table
小部件放在弹出窗口中,没有列将允许您自定义
项目出现,但您喜欢。
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
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.
这篇关于改变日食menuitem颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!