How to change SWT Tree plus/minus icons

可紊 提交于 2019-12-04 06:56:29

The SWT Tree component makes use of native Tree widget if available, for example in case of Windows - it uses native widget while on Linux (depends on the UI engine being used), it may create custom tree on its own.

On the OS where it uses native Tree widget, it's not possible to customize the + and - icons.

As Ali suggested (see http://msdn.microsoft.com/en-us/library/bb773568%28VS.85%29.aspx), you may wish to use TVE_EXPANDPARTIAL, but keep in mind that the code will be OS dependent (even within versions of Windows).

You may, however, wish you use a custom image - using getImage() method in the TreeContentProvider to indicate the otherwise rather than relying on TVE_EXPANDPARTIAL. This will also ensure that your code is OS independent.

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