• 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: NSIndexSet of NSButtonCells in NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSIndexSet of NSButtonCells in NSOutlineView


  • Subject: Re: NSIndexSet of NSButtonCells in NSOutlineView
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 08 Dec 2011 10:13:32 -0800

On Dec 8, 2011, at 08:12 , Gilles Celli wrote:

> The instrument's name is selectable as an NSButtonCell, the idea is to turn on/off its respective graph / plot.
> So there's a mix of NSButtonCells along with NSString in the NSOutlineView.
> My model's NSButtonCells are based of NSMutableDictionary which will change the integerValue of NSButton for their resp. key, this works.
>
> I've setup an NSArray to store the selected instruments.
> In fact I've problems creating the NSIndexSet of the selected instruments and not knowing where to put the whole code.

Your question is unclear. Because we're talking about a NSOutlineView, "selected" means what you're calling "highlighted" below. It's better not to use "selected" to refer to the on/off state of your button cells. Let's call that "active".

> Should I put the code in
> In outlineView: objectValueForTableColumn:byItem:(id)item or in
> outlineView:setObjectValue:forTableColumn:byItem:  ?

If you're trying to maintain a NSArray of "active" instruments, the correct place would be outlineView:setObjectValue:forTableColumn:byItem:, since that's the point at which you get told of the change of state.

> Putting it in the NSOutlineView notification method -(void)outlineViewSelectionDidChange:(NSNotification *)notification is bad idea (I think) since then
> the NSButtons are only changing their state if the row of the NSOutlineView is highlighted / selected.
>
> I want to have the user change the state of the buttons whithout first selecting the row of the outlineview.
>
> So should I alway recreate a new NSIndexSet for the selected NSButtonCells ? If yes in which method should I put the code ?

I'm not sure what the NSIndexSet is for. Do you mean "selected" or "active"?

_______________________________________________

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: NSIndexSet of NSButtonCells in NSOutlineView
      • From: Gilles Celli <email@hidden>
References: 
 >NSIndexSet of NSButtonCells in NSOutlineView (From: Gilles Celli <email@hidden>)

  • Prev by Date: Re: App crashing when adding to Open Recent menu
  • Next by Date: Re: ARC and dealloc
  • Previous by thread: NSIndexSet of NSButtonCells in NSOutlineView
  • Next by thread: Re: NSIndexSet of NSButtonCells in NSOutlineView
  • Index(es):
    • Date
    • Thread