How can I change the cursor when it's over an NSButton?
You should subclass NSButton first, then add the code below.
- (void)resetCursorRects
{
if (self.cursor) {
[self addCursorRect:[self bounds] cursor: self.cursor];
} else {
[super resetCursorRects];
}
}
Now you can set cursor as you like.
[self.button setCursor:[NSCursor pointingHandCursor]];
Note: add cursor
as a property of your subclass, like this:
@property (strong) NSCursor *cursor;