• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: contextual menu for NSCell in NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: contextual menu for NSCell in NSOutlineView


  • Subject: Re: contextual menu for NSCell in NSOutlineView
  • From: Scott Ruda <email@hidden>
  • Date: Mon, 13 Sep 2004 15:39:16 -0700


On Sep 13, 2004, at 1:25 PM, Ondra Cada wrote:

On 13.9.2004, at 20:23, Scott Ruda wrote:

... I've also overridden menuForEvent: in the outline view, but it is never called. The ADC documentation for these messages seems to be pretty sparse with no mention of use cases.

Hmmm... you sure? I did it many times with a table view and once or twice with an outline view, and it always did work like a charm -- the basic principle (extending a delegate services for that) was something like


@interface OCSAddPopupMenuToAnyTableView:NSTableView @end
@implementation OCSAddPopupMenuToAnyTableView
-(NSMenu*)menuForEvent:(NSEvent*)evt {
...

Oops, my mistake in the posting! I tried overriding NSCell's menuForEvent:inRect:ofView: not NSOutlineView's menuForEvent:. It's the one in NSCell that never gets called.

I assumed that the outline view would drill into the cells by itself, essentially like your code does, and then would call NSCell's menuForEvent: selector, and by default return the menu set with setMenu:. Apparently not.

I was going back and forth trying to figure out if I needed to do the deed in the outline view or in the cell. You're well factored code shows me exactly what I needed and works great. Thanks.

I'm still left trying to understand the role of NSCell's menuForEvent:inRect:ofView: and setMenu: selectors. Are they just convenience stubs that are never called by the standard frameworks?

_______________________________________________
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


References: 
 >contextual menu for NSCell in NSOutlineView (From: Scott Ruda <email@hidden>)
 >Re: contextual menu for NSCell in NSOutlineView (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: NSArrayController and Array Operators Bindings
  • Next by Date: Re: Newbie suggestion required: WebKit thumbnail generation
  • Previous by thread: Re: contextual menu for NSCell in NSOutlineView
  • Next by thread: iPhoto Style table view
  • Index(es):
    • Date
    • Thread