Re: What is the best way to use NSOutlineView without NSTreeController?
Re: What is the best way to use NSOutlineView without NSTreeController?
- Subject: Re: What is the best way to use NSOutlineView without NSTreeController?
- From: glenn andreas <email@hidden>
- Date: Thu, 1 Dec 2005 22:51:11 -0600
On Dec 1, 2005, at 10:40 PM, Andrei Tchijov wrote:
I am trying to build kind of "Master-Detail" interface where
"Master" is NSOutlineView. My application have to run on Panther,
so I can not use NSTreeController. I still would love to use
"bindings" for "Detail" part of the interface. What is the best
way to do it?
I can create a Key/Value compatible class which provides access to
currently selected item in NSOutlineView. If I use
NSObjectController that has object of this class as a content, then
I can bind my controls from "Detail" part to this controller and it
looks like my updates do get through to the current item from
NSOutlineView. What I can not figure out is how to tell/force
NSObjectController, that selection has been changed in NSOutlineView.
Your advice/comments/ideas will be greatly appreciated
Andrei
Assuming the KVC class which "serves" the currently selected item
provides something along the lines of:
- (id) currentlySelectedOutlineItem;
have that class listen to NSOutlineViewSelectionDidChangeNotification
on the outline table. In the routine that handles that notification:
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
{
[self willChangeValueForKey: @"currentlySelectedOutlineItem"];
[self didChangeValueForKey: @"currentlySelectedOutlineItem"];
}
If the instance of this class is the delegate of the outline view,
you won't need to register with the notification center (since
delegates automatically get these for free).
Glenn Andreas email@hidden
<
http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
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