setTextColor, display string, then set it back not working
setTextColor, display string, then set it back not working
- Subject: setTextColor, display string, then set it back not working
- From: Walker Argendeli <email@hidden>
- Date: Tue, 6 Jan 2009 15:34:36 -0500
Ok, so I have a NSTextField (a label) called countDisplay, and when a
zero-length string is entered into another text field, I'd like to
change the color of countDisplay to red, display a message, and change
back to black again. Only problem is that it displays in black no
matter what. When I comment out the last line of this code, the
string correctly displays in red, but then, since the last line is
commented out, doesn't change back. But if I uncomment the last line
again, countDisplay remains black, displaying the message in black
instead of red. What's going on?
// Set display text to red for zero-length warning...
[countDisplay setTextColor:[NSColor redColor]];
[countDisplay setStringValue:@"***Please enter a string***"];
// ...and back again
[countDisplay setTextColor:[NSColor blackColor]];
_______________________________________________
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