drawing red text for some cells while editting in NSTableView
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