问题
How to create a NSButton with non-square "hit area"?
Example:
Thanks.
回答1:
You could probably subclass NSButton and override hitTest:
to return nil when outside the area you want to be clickable. (Return [super hitTest:]
when inside.)
Docs here.
来源:https://stackoverflow.com/questions/10313938/non-square-nsbutton