Re: Binding Image and Text into a NSTextFieldCell
Re: Binding Image and Text into a NSTextFieldCell
- Subject: Re: Binding Image and Text into a NSTextFieldCell
- From: Jerry Krinock <email@hidden>
- Date: Fri, 24 Apr 2009 13:46:46 -0700
On 2009 Apr 24, at 11:55, Arun wrote:
Does any one know how to bind Image and Text into a NSTextFieldCell?
I don't believe you can do that with NSTextFieldCell.
I believe this would work: First of all add or identify a single
'foo' attribute in your data object model from which both data and
text can be extracted. Set up your bindings in the normal way: Bind
the table column's 'value' through an array controller to
arrangedObjects.foo. Then subclass NSCell, overriding -
drawInteriorWithFrame:inView: to extract the image and text from -
objectValue and draw them where you want them. In the table column's -
dataCellForRow:, return an instance of this NSCell subclass.
_______________________________________________
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