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

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


  • Follow-Ups:
    • Re: setTextColor, display string, then set it back not working
      • From: Graham Cox <email@hidden>
  • Prev by Date: Large Core Data memory allocations for small rows
  • Next by Date: Re: Programmatically locking user screen
  • Previous by thread: re: Large Core Data memory allocations for small rows
  • Next by thread: Re: setTextColor, display string, then set it back not working
  • Index(es):
    • Date
    • Thread