I made a custom view for my button in the menu bar. Since I added it as subview, it got rid of the effect when the button got clicked like here with the battery:
Now I saw that I can override the mouseDown effect und mouseUp to do this effect manually. Does anyone know how I could add this kind of effect?
Edit: for example, it would solve my problem, if I knew how to paint the background of my rectangle in my custom NSView