Re: Contextual menus in Outline Views
Re: Contextual menus in Outline Views
- Subject: Re: Contextual menus in Outline Views
- From: Mark Lilback <email@hidden>
- Date: Fri, 7 Jan 2005 09:52:15 -0600
At 11:56 AM +0000 1/7/2005, Thomas Davie wrote:
Is there any way to add the appropriate contextual menu?
Here is the code I use in a generic NSOutlineView subclass that
passes contextual menu handling off to the delegate.
-(NSMenu*)menuForEvent:(NSEvent *)theEvent
{
int row = [self rowAtPoint: [self convertPoint: [theEvent
locationInWindow] fromView: nil]];
if (row != -1) {
[self selectRow: row byExtendingSelection: NO];
}
if ([delegate respondsToSelector: @selector(menuForEvent:)])
return [[self delegate] menuForEvent: theEvent];
return nil;
}
--
__________________________________________________________________________
"The fetters imposed on liberty at home have ever
Mark J. Lilback been forged out of the weapons provided for
<email@hidden> defence against real, pretended, or imaginary
http://www.lilback.com/ dangers from abroad." -- James Madison
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden