问题
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