• 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
Re: setTextColor, display string, then set it back not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: setTextColor, display string, then set it back not working
      • From: Walker Argendeli <email@hidden>
References: 
 >setTextColor, display string, then set it back not working (From: Walker Argendeli <email@hidden>)

  • Prev by Date: Re: Design Advice - Bread Crumbs, NSPathControl
  • Next by Date: Re: How to get slider events as it moves?
  • Previous by thread: setTextColor, display string, then set it back not working
  • Next by thread: Re: setTextColor, display string, then set it back not working
  • Index(es):
    • Date
    • Thread