Re: Displaying "helper text" in empty text fields
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.