Reputation: 3061
This is a simple question...
Just: How would I go about subclassing NSMenu? As I'm not sure about how to go about doing it.
I'd like to subclass it in order to do custom drawing eg. change background colour etc.
This is normally done with - (void)drawRect:(NSRect)dirtyRect
thus I tried subclassing and using that method, to no avail.
Upvotes: 0
Views: 1922
Reputation: 237010
You can't do this by subclassing NSMenu. You want to use NSMenuItem's setView:
to do custom drawing in a menu. Take a look at the MenuItemView sample code for an example of how it's done and what you can do with it.
Upvotes: 2