Set tooltip text for each element in an SWT Combo widget

一曲冷凌霜 提交于 2019-12-11 02:55:08

问题


I've been looking around for ages and can't seem to find whether this is possible or not.

I have a Combo widget populated with some strings and wan't to set the tool tip text to be something different for each item in the Combo widget. i.e. When you mouse over an item in the Combo widget a string is displayed above the mouse icon.

For example if there are 2 items in the Combo widget, Foo and Bar, can you set the tool tip text to be "Foo" when you mouse over Foo and "Bar" when you mouse over Bar??

Any advice/insights would be great, thanks!


回答1:


The solution by Edward Thomson is probably the best one, but if you don't want to code, you might use TooltipCCombo class from blog post Tooltip enabled CCombo for SWT (at your's own risk).



来源:https://stackoverflow.com/questions/15509350/set-tooltip-text-for-each-element-in-an-swt-combo-widget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!