• 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
custom NSTextField issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

custom NSTextField issue


  • Subject: custom NSTextField issue
  • From: Stefan Schüßler <email@hidden>
  • Date: Sat, 2 Aug 2003 10:43:15 +0200

I'm trying to customize a NSTextField the way the search fields work in Mail and Safari. I.e. it should display a gray text if the field is (left) empty and delete this text if the user enters the field.

Subclassing NSTextField and overriding becomeFirstResponder works fine in the latter case. However, overriding resignFirstResponder does not work as expected, as a NSTextField yields control (first responder) as soon as it is activated. Therefore I'm unable to tell when the user is leaving the text field. NSTextField's textShouldEndEditing method does now work either since it is only called if the user has actually entered some text. Tabbing in and out the text field does not send this message.

Any suggestions?

Stefan
_______________________________________________
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: custom NSTextField issue
      • From: Stefan Schüßler <email@hidden>
  • Prev by Date: Re: Optimizing for code size
  • Next by Date: Re: Problem creating an NSButton subclass in Java
  • Previous by thread: Re: Optimizing for code size
  • Next by thread: Re: custom NSTextField issue
  • Index(es):
    • Date
    • Thread