Re: Custom editable cell on NSOutlineView
Re: Custom editable cell on NSOutlineView
- Subject: Re: Custom editable cell on NSOutlineView
- From: Florent Pillet <email@hidden>
- Date: Sun, 04 Nov 2007 23:06:41 +0100
Dorian Johnson wrote:
I have an NSOutlineView that needs each cell to have a small icon and be
editable.
So far, I've used NSBrowserCell, which does the icon perfectly but
refuses to work with editing. I also tried the ImageAndTextCell sample
code from ADC (
http://developer.apple.com/samplecode/ImageBackground/listing4.html ),
which has code in it for editing, but it doesn't work either (again,
icons and text display properly, but editing doesn't function). Editing
works fine if I revert to the default data cell. Any ideas on how I can
get editing and the icon working?
Here's how I'm setting the data cell (for NSBrowserCell, on a
NSOutlineView with one column):
NSBrowserCell *browserCell = [[[NSBrowserCell alloc] init]
autorelease];
[browserCell setLeaf:YES];
[[[_hierarchyView tableColumns] objectAtIndex:0]
setDataCell:browserCell];
You initialization lacks:
[browserCell setEditable:YES];
This should be enough.
Hope this helps,
Florent
_______________________________________________
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