• 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 for an NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Contextual Menus for an NSOutlineView


  • Subject: Contextual Menus for an NSOutlineView
  • From: Justin Wood <email@hidden>
  • Date: Thu, 22 Nov 2001 05:59:53 -0500

I've been trying to get this working for some time now, but to no avail, its
got me quite puzzled.

I have an NSOulineView displaying all sorts of data and I need to create
contextual menus for some of the items. It seemed quite easy, the delegate
method:

- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn item:(id)item

Hands us a nice referece to the cell, which is apparantly a descendant of
NSCell. NSCell seems to have the method, - [NSCell setMenu:(NSMenu *)menu].

So I tried to use this, no response at all. In my searching around, I found
a mention that I should try setting the actual data cell for the
tableColumn, so I tried that... [[tableColumn dataCell] setMenu: myMenu],
still no dice.

If I actually set the outlineView's menu ( [oulineView setMenu: myMenu] ),
then I can get a menu, but for the whole view. And it doesn't pass the
clicks through. For example, if I click where one of the rows should be
(control click that is), no row is selected, it just pops open a contextual
menu, which makes sense, as I set the menu for the entire view, not each
cell.

Anyway! The long and short of it is, I have no idea what to do, and I'd
appreciate any advice anyone might have, I'm sure there must be a relatively
simple way of doing this, it doesn't seem to be a feature that is quite 'out
there'.


Thanks in advance... I need to grab some shut eye :)

- Sincerely,
Justin Wood


  • Follow-Ups:
    • Re: Contextual Menus for an NSOutlineView
      • From: Max Horn <email@hidden>
    • Re: Contextual Menus for an NSOutlineView
      • From: John Hörnkvist <email@hidden>
  • Prev by Date: automatic spell checking
  • Next by Date: Re: Contextual Menus for an NSOutlineView
  • Previous by thread: Re: automatic spell checking
  • Next by thread: Re: Contextual Menus for an NSOutlineView
  • Index(es):
    • Date
    • Thread