I\'m trying to create a menu with a drop down menu with a custom background for every cell. First i tried to adapt NSPopUpButton but i couldn\'t find a way to change the cells b
I'm not sure if I understood your question correctly. If you want to show a menu at an arbitrary position somewhere in your UI: NSMenu provides convenience methods for achieving that. Have a look at the documentation for + popUpContextMenu:withEvent:forView:
, + popUpContextMenu:withEvent:forView:withFont:
and – popUpMenuPositioningItem:atLocation:inView:
to find the one that best fits your needs. Like that you can display a menu at whatever position you like.
If you instead want to display arbitrary content inside a menu, have a look at the documentation of NSMenuItem
's - setView:
. This allows you to insert views inside menus. Together with the above method of displaying menus wherever you want, you can create all sorts of solutions for "PopOver" needs.