Re: setTextColor, display string, then set it back not working
Re: setTextColor, display string, then set it back not working
- Subject: Re: setTextColor, display string, then set it back not working
- From: Graham Cox <email@hidden>
- Date: Wed, 7 Jan 2009 14:53:06 +1100
On 7 Jan 2009, at 7:34 am, Walker Argendeli wrote:
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]];
You do realise that the time between setting red and then back to
black is measured in nanoseconds, right? But even if your computer had
a clock speed of 1Hz, you wouldn't see the change anyway because the
screen is only updated at the end of each event cycle.
You need to arrange for the reset to black to occur after a useful
time delay, maybe by kicking off a timer and then setting black in its
callback method.
--Graham
_______________________________________________
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