Re: NSButtonCell visibility binding in NSOutlineView
Re: NSButtonCell visibility binding in NSOutlineView
- Subject: Re: NSButtonCell visibility binding in NSOutlineView
- From: Ashley Clark <email@hidden>
- Date: Wed, 29 Apr 2009 10:13:37 -0500
On Apr 28, 2009, at 12:12 PM, Chris Tracewell wrote:
I am looking for the best method of turning off the visibility of an
NSButtonCell object for individual rows in an OutlineView/TableView.
I have an OutlineView that is bound to a TreeController. There are
two columns. In the last column I am using a checkbox cell that
should only be visible to the user when a representedObject in the
TreeController has a certain property value. There is no Visibility
binding only Enabled which does not hide the control but just dims it.
I am using bindings to return a custom image for setImage and
setAlternateImage to display a custom NSImage instead of the regular
checkbox. It works nicely. I tried using conditional logic to return
a transparent image when I want to hide the control but that affects
the entire column. If I need to subclass I am suspecting I need to
override NSTableColumn's dataCellForRow, but then how do I obtain
the representedObject for that row?
Why not just implement -
outlineView:willDisplayCell:forTableColumn:item: on your delegate and
then set your images there depending on what item is about to be
displayed?
Ashley
_______________________________________________
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