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: Fri, 2 Dec 2005 16:34:19 -0600
On Dec 2, 2005, at 4:14 PM, Andrei Tchijov wrote:
Glenn,
Thanks for reply, but I already have tried this kind of approach
and it looks like it does not work. Problem number one, when you
are switching from "none selected" to "one selected",
"willChangeValueForKey" generate exception
( removeObserver:forKeyPath: was sent to an object that has no
observers ). I can solve this by doing "willChangeValueForKey" in
selectionShouldChangeInOutlineView only if something was selected.
Problem number 2 is that it still does not work. When I type in
text field (which is bound to path ), proper object gets updated,
but when I change selection, text field does not get updated.
If I understand this correctly, problem number 2 is related to the
concept of the "field editor" and when changing selection you'll want
to make sure to commit the current edit select (or cancel the
selection if the commit doesn't work - for example, if the field has
a number with a min and max value, and the user typed something
beyond that). The NSTreeController automatically handles that for
you (which is why setSelectionIndexPath returns a BOOL to indicate if
it was successful).
Look into NSEditorRegistration informal protocol and NSEditor
informal protocol (especially "commitEditing").
(Of course, this only applies if your detail view includes things
like edit fields - things like popup menus, sliders, checkboxes,
etc... all happen without any need to be committed).
Glenn Andreas email@hidden
<
http://www.gandreas.com/> wicked fun!
quadrium | build, mutate, evolve | images, textures, backgrounds, art
_______________________________________________
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