I'm trying to change the opacity of a NSMenu, I made custom NSMenuItems and changed their opacity but there is still the white color of menu behinde them, I'm looking for a way too change the color and opacity of the menu background. I was wondering if it's even possible?
Regards
I don't think there is an elegant way to do that. NSMenu
isn't a subclass of NSView
. The rendering view is probably a private variable of the menu object.
NSMenuItem
has a view
property that you can use. Try setting a custom view (if you don't already) and later find the menu's view by calling menuItem.view.superview
. Then set that view's alpha
property.
Alternatively you could try to find the private view
property of NSMenu
with a tool like class-dump
. Note that using private variables is never a good idea. Especially if you're planning to release the app on the App Store.