I want to draw a custom focus ring for my NSTextView
subclass (which doesn't have a focus ring by default). I managed to implement it by overriding the parent NSScrollView
drawRect
and adding this code:
- (void)drawRect:(NSRect)dirtyRect {
if (focused) {
NSSetFocusRingStyle(NSFocusRingOnly);
NSRectFill(dirtyRect);
}
[super drawRect:dirtyRect];
}
However, I want to draw my own, custom focus ring. I have searched and searched for examples of this, and tried messing around and writing it myself, to no avail. The biggest issue I have is the fact that it will get cropped to the NSScrollView
/NSTextView
frame, no matter how I do it.
Thanks.