سؤال

How to create a NSButton with non-square "hit area"?

Example:

enter image description here

Thanks.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top