Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zmagi

macrumors newbie
Original poster
Nov 29, 2018
9
0
The button must not be clickable outside the button border.

- (void)applicationDidFinishLaunching: (NSNotification *)aNotification {
NSButton *btn = [[NSButton alloc] initWithFrame:NSMakeRect(20, 20, 80, 80)];
[btn setBezelStyle:NSCircularBezelStyle];
[btn setTitle: @"+"];
[[_window contentView] addSubview:btn];
}

img link (tinypic.com/view.php?pic=11a8ysk&s=9)

View attachment 807294
 
It isn't. Your button is 80x80 (the image doesn't quite match your code), what are you expecting?

The click area should be restricted on the NSButton and not outside the NSButton.

There must be a way to restrict the click area to a GCRect.
if not then there must be a way to override the NSButton Class.
 
The active area is not outside the button. The button is the size of the rectangle you set, not the title (if that is what you are wanting).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.