0
votes

I work on a custom OS-X Cocoa menu bar app. I put a custom NSView as subview on the NSStatusItem's button. It looks ok, however when selecting the button the blue highlight has overlay issues:

enter image description here

I'm using NSColor.clear wherever possible - the only thing the custom NSView is presenting is a NSBezierPath (circle) and NSText (text) - both with transparent background. I might have a completely wrong approach, didn't know other way to put those custom views there.

So my question is if it's possible to show a full button selection overlay (blue highlight) on mouse click or this is a wrong concept (to use custom views on NSButton)?

1

1 Answers

0
votes

If you are creating a button programmatically, set its type to momentaryChange. Or you can do it with the interface builder.

btn.setButtonType(.momentaryChange)