2012-04-25 36 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.