NSIndexSet of NSButtonCells in NSOutlineView
NSIndexSet of NSButtonCells in NSOutlineView
- Subject: NSIndexSet of NSButtonCells in NSOutlineView
- From: Gilles Celli <email@hidden>
- Date: Thu, 08 Dec 2011 17:12:46 +0100
Hi,
I've the following problem:
I'm writing an application which will display plots / graph: an NSOutlineView has been setup and working which displays the name, location
of some scientific instruments (like thermometer, voltage etc.).
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.
Should I put the code in
In outlineView: objectValueForTableColumn:byItem:(id)item or in
outlineView:setObjectValue:forTableColumn:byItem: ?
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 ?
Maybe there's a more elegant solution to this….any clues ?
Any help is greatly appreciated.
Cheers,
Gilles
_______________________________________________
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