2012-04-25 38 views
3

如何用非方形“命中区域”创建一个NSButton?非方形NSButton

实施例:

enter image description here

感谢。

+0

我发现正是我需要在这里:http://www.harmless.de/cocoa-code.php AMShapedButton类 – andron 2012-04-26 08:22:01

回答

2

你可能会继承NSButton的子类并覆盖hitTest:在想要点击的区域之外返回nil。 (返回[super hitTest:]里面的时候。)

Docs here.