• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Which field is the NSTextFieldCell drawing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Which field is the NSTextFieldCell drawing?
      • From: Jim Correia <email@hidden>
  • Prev by Date: microsoft file formats in cocoa
  • Next by Date: Re: [iPhone] Settings Application...need an Image Picker
  • Previous by thread: Re: microsoft file formats in cocoa
  • Next by thread: Re: Which field is the NSTextFieldCell drawing?
  • Index(es):
    • Date
    • Thread