Yes, although it's not completely clear to me what the content should be. It seems that's usually application-specific?
As it's a NSView subclass, wouldn't it already have a menu outlet? And you could always subclass THCanvasView and override -menuForEvent:. But all the cool kids use delegates.
by Blain — Oct 16
As it's a NSView subclass, wouldn't it already have a menu outlet? And you could always subclass THCanvasView and override -menuForEvent:. But all the cool kids use delegates.
- (NSMenu *)menuForEvent:(NSEvent *)theEvent; { if ((_delegate != nil) && ([_delegate respondsToSelector:@selector(canvasView:menuForEvent:)]) { return [_delegate canvasView: self menuForEvent: theEvent]; } return [super menuForEvent:theEvent]; }
Adding delegate accessors is left as an exercise to the reader.