Close button in CTabFolderRenderer in SWT

江枫思渺然 提交于 2019-12-24 13:58:54

问题


I have a requirement to have a close Button(Native) in CTabFolder for close action. To say precisely I need a native Button with text "close". I have a CustomCTabFolderRenderer with drawClose method being overidden. I did manage to draw an image, but client didn't like that. Rather than drawing any polygon or image using the GC is there any way to draw a native Button? I could have drawn a rectangle with some text, but I'm worried that it cant give a native look. I would be pretty much happy even if I can get a solution to draw a Windows OS button(I mean any implentation that works just on windows)


回答1:


As reported here, there is currently no way to draw native OS resources yourself, i.e. SWT does not supply methods to do this.

Furthermore, you can't subclass CTabFolder without a great amount of voodoo power.


As a conclusion: There is no "easy" way to do this. If it is possible, it would require a lot of work.



来源:https://stackoverflow.com/questions/16658840/close-button-in-ctabfolderrenderer-in-swt

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