Which field is the NSTextFieldCell drawing?
Which field is the NSTextFieldCell drawing?
- Subject: Which field is the NSTextFieldCell drawing?
- From: "K. Darcy Otto" <email@hidden>
- Date: Sat, 16 May 2009 18:05:49 -0700
I have an NSTextFieldCell subclass that needs to draw itself
differently depending on which NSTableView row it is drawing. My
current solution is to store the row that is being drawn in my
document class in an instance variable (the assignment is done in -
tableView:willDisplayCell:forTableColumn:row:), and have my
NSTextFieldCell read out that variable prior to drawing itself. Is
there a more direct way to do this? Is it possible to either:
(1) Have the NSTextFieldCell subclass look up the row that is
currently being drawn, or
(2) Store the row to be drawn in an instance variable of the
NSTextFieldCell.
I think (1) would be the easiest. What is preventing (1) is that I'm
not sure how to query the NSTableView to ask it what object is
currently being drawn. What is preventing (2) is that I'm not sure
how to get a pointer to the NSTextFieldCell subclass object that is
about to be drawn, and insert the appropriate information just before
it is drawn.
Thanks in advance for any help.
_______________________________________________
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