• 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: becomeFirstResponder and resignFirstResponder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: becomeFirstResponder and resignFirstResponder


  • Subject: Re: becomeFirstResponder and resignFirstResponder
  • From: Mike Ferris <email@hidden>
  • Date: Sun, 29 Dec 2002 10:42:54 -0800

The reason they both happen immediately is that an NSTextField actually uses and NSTextView for editing. So, as soon as it is made first responder, it starts editing and hands over first responder status to the NSTextView editor. While a control is editing, the -currentEditor method will return a non-nil value. You might be able to catch when editing starts by overriding NSTextFieldCell's -editWithFrame:... and selectWithFrame:... methods. And you can probably find out when it ends by overriding NSTextField's -textDidEndEditing:.

Mike


Begin forwarded message:

From: "Shoaib" <email@hidden>
Date: Sun Dec 29, 2002 8:27:54 AM US/Pacific
To: "email@hidden" <email@hidden>, "email@hidden" <email@hidden>
Subject: becomeFirstResponder and resignFirstResponder

I have subclassed NSTextField and overridden becomeFirstResponder and resignFirstResponder methods. Everytime I click in my custom NSTextField, both the methods get called, instead of just becomeFirstResponder. Is there a reason for this?

I want to show a border around the NSTextField while the user is in there, and remove the border when the user has left the NSTextField, but can't seem to because both methods get called at the same time.
_______________________________________________
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.
_______________________________________________
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.

References: 
 >becomeFirstResponder and resignFirstResponder (From: "Shoaib" <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: Best way to get different events for a button mouseDown and mouseUp?
  • Previous by thread: becomeFirstResponder and resignFirstResponder
  • Next by thread: multithreading limits?
  • Index(es):
    • Date
    • Thread