Skip navigation.
 
mlControlling field editor for an outline view
FROM : John Stiles
DATE : Tue Jan 08 23:35:12 2008

I'm trying to set up a custom field editor for an NSOutlineView. When it
displays, its contents are not necessarily the same as the cell being
displayed by the outline view. For instance, consider the Xcode project
settings dialog—it has a table that displays stuff like:
    Build Location            /Volumes/MyDrive/MyFolder

But when you go to edit it, it changes to
    Build Location            $(BUILD_LOC)

I'm basically trying to do something similar to that. So how is this done?

If it matters, I'm beginning the edit session programmatically (in this
case, in response to a menu selection). I suppose in this case I might
be able to get away with changing the cell's string just before the edit
begins, and change it back as soon as the edit completes, but that's
pretty hokey; I think it would be a cleaner solution to just put the
appropriate text in the field editor and leave the cell's string alone.
I just can't manage to make it work though.

I've tried using the delegate method -control:textShouldBeginEditing:
but this was a total bust; it's not called until the user begins typing.

I've also tried adding -editWithFrame:inView:editor:delegate:event: to
my NSCell subclass but this did not seem to ever be called, strangely.
(I did notice that -selectWithFrame:inView:… etc. /is/ being called, but
that is probably because I am using "select:YES" in my call to
-editColumn:row:withEvent:select:.)

Related mailsAuthorDate
mlControlling field editor for an outline view John Stiles Jan 8, 23:35
mlRe: Controlling field editor for an outline view John Stiles Jan 9, 00:12
mlRe: Controlling field editor for an outline view John Stiles Jan 9, 03:32
mlRe: Controlling field editor for an outline view Ken Thomases Jan 11, 02:15
mlRe: Controlling field editor for an outline view John Stiles Jan 11, 04:05