Controlling field editor for an outline view
Controlling field editor for an outline view
- Subject: Controlling field editor for an outline view
- From: John Stiles <email@hidden>
- Date: Tue, 08 Jan 2008 14:35:12 -0800
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:.)
_______________________________________________
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