• 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: Displaying "helper text" in empty text fields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying "helper text" in empty text fields


  • Subject: Re: Displaying "helper text" in empty text fields
  • From: Brian Webster <email@hidden>
  • Date: Fri, 19 Jul 2002 14:29:39 -0500

On Friday, July 19, 2002, at 01:47 PM, cocoa-dev-
email@hidden wrote:

Basically if the actual contents of the field is empty, I want to
display a helper string in gray text until the user clicks. Then it
should be cleared.

Any ideas?

You can do a setStringValue: followed by a setTextColor: on the NSTextField to display colored text. To clear the field out when the user clicks in it, implement the method controlTextDidBeginEditing: in your text field's delegate object. You can then set the string value to @"" so that the text field is clear when it begins an editing session.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Displaying "helper text" in empty text fields
      • From: Charles Jolley <email@hidden>
  • Prev by Date: Re: Creating a .menu
  • Next by Date: Thanks everyone!
  • Previous by thread: Crash problem in framework code
  • Next by thread: Re: Displaying "helper text" in empty text fields
  • Index(es):
    • Date
    • Thread