• 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
drawing red text for some cells while editting in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drawing red text for some cells while editting in NSTableView


  • Subject: drawing red text for some cells while editting in NSTableView
  • From: Ken Victor <email@hidden>
  • Date: Thu, 26 Apr 2007 17:40:52 -0700

one of the columns in my table view has an NSNumberFormatter that draws red text for negative numbers.

this works fine as long as the user isn't editting one of the cells in the column; in this case, the editted text takes on the same color as all the other columns of the table.

what i would like is that if the string being editted (in this column) has a minus sign prefix, then the text should appear red, even while being editted. if the user deletes the minus sign, then the text should change to the "normal" color for the table. and similarily, if the user then enters a minus sign, the text being edited should turn red.

i believe i can accomplish this by having a custom field editor and overriding insertText, paste, deleteBackward, deleteForward, deleteWordBackward, deleteWordForward, resignFirstResponder, and becomeFirstResponder.

i'd like to know if anyone can suggest perhaps a simpler approach.

thanx,
ken
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: Many-To-Many Relationship Interface in Core Data
  • Next by Date: Re: Many-To-Many Relationship Interface in Core Data
  • Previous by thread: Re: How to change scroll view size so it can scroll
  • Next by thread: setting minimum size for NSView to display all content without scroll view
  • Index(es):
    • Date
    • Thread