• 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
Contextual menus in view-based NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Contextual menus in view-based NSOutlineView


  • Subject: Contextual menus in view-based NSOutlineView
  • From: Graham Cox <email@hidden>
  • Date: Thu, 12 Jun 2014 10:55:04 +1000

I'm having trouble getting contextual menus to work in a view-based NSOutlineView.

I can set a menu on the whole outline view and that works, but I also need to have menus for each row. Setting a menu on the NSTableCellView subclass in IB doesn't work at all - it seems as if the menu isn't copied when the view is instantiated from the nib (the -menu property is nil on the view instance). But if I override -menu, or -menuForEvent: and return something, it is still not used. In fact those methods are never invoked. If I do the same on the NSTableRowView subclass, then the menu shows, but only if I click in areas that are not occupied by views within my cell view, which is not useful. If the table row gets the menu highlight, then the menu doesn't show (and the -menu method on the row isn't invoked).

I did get this working in a cell-based outline view a few years ago, but with a view-based OV, I can't find the magic fairy dust I need. The simplest way would be just to set up the view's menu in IB, but it seems that's broken or overlooked in the OV implementation. Can anyone suggest a workaround other than those I've tried?

--Graham



_______________________________________________

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


  • Follow-Ups:
    • Re: Contextual menus in view-based NSOutlineView
      • From: Lee Ann Rucker <email@hidden>
  • Prev by Date: Re: Text System Locks Up - Can't Find Reason
  • Next by Date: Re: Contextual menus in view-based NSOutlineView
  • Previous by thread: Re: Text System Locks Up - Can't Find Reason
  • Next by thread: Re: Contextual menus in view-based NSOutlineView
  • Index(es):
    • Date
    • Thread