NSCheckbox right click in an NSOutlineView
NSCheckbox right click in an NSOutlineView
- Subject: NSCheckbox right click in an NSOutlineView
- From: Alex Kac <email@hidden>
- Date: Wed, 01 Apr 2015 08:34:35 -0600
I have an NSCheckbox in a view based NSOutlineView. I want to support
Control-click for the right click menu when a user control-clicks on the
cell. Right click works perfectly already per the standard NSOutlineView.
However because the NSCheckbox is eating the click, it doesn't do a right
click menu when you control-click.
https://www.dropbox.com/s/zjt5heg0mgotatd/Screenshot 2015-04-01 08.34.26.png?dl=0
I've been trying different things, but via SO it seems like people subclass
NSButton to check for the control click:
- (void) mouseDown:(NSEvent *)theEvent
{
if ((theEvent.modifierFlags & NSControlKeyMask) == NSControlKeyMask)
{
// [[self nextResponder] rightMouseDown:theEvent];
}
else
[super mouseDown:theEvent];
}
However I now need to figure out how to get to the parent where a
rightMouseDown brings up the menu. I'm sure this can't be all that uncommon
- so what's the best way to handle this?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden