Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: becomeFirstResponder and resignFirstResponder



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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.