Does anyone no if it’s possible to change the color of individual titles of an NSMatrix. I’ve got a column of radio buttons and I’d like to be able to change the color to red for the selections that It is suggested that the users do not select. I think that I’ve got it figured out for text fields but I couldn’t find a way to do it for matrices. I’m thinking that I might have to delete the titles, and put text labels adjacent to the matrix, but I’d rather do it directly if possible. Thanks in advance for any help.
I think you have to do it using attributed strings. This worked for me to change the title of the first item in a radio button matrix:
set txtColor to current application's NSColor's redColor() set txtDict to current application's NSDictionary's dictionaryWithObjectsAndKeys_(txtColor, current application's NSForegroundColorAttributeName, missing value) set attrStr to current application's NSAttributedString's alloc() attrStr's initWithString_attributes_("First Item", txtDict) mycell's setTitle_(attrStr)
myCell is a property connected to the top cell of the matrix.
That did it. Thanks!