NSText textShouldBeginEditing behavior ?
NSText textShouldBeginEditing behavior ?
- Subject: NSText textShouldBeginEditing behavior ?
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 3 May 2001 16:01:01 +0200
According to the documentation,
NSText - (BOOL)textShouldBeginEditing:(NSText *)aTextObject delegate
method should be called when the Control view wants to become first
responder:
"Invoked from a text object's implementation of becomeFirstResponder,
this method requests permission for aTextObject to begin editing. If the
delegate returns YES, the text object proceeds to make changes. If the
delegate returns NO, the text object abandons the editing operation.
This method is invoked whenever aTextObject attempts to become first
responder."
I'm not pretty sure to correctly understand what it means by attempting
to become first responder.
I have a NSTableView with one column whose rows are text field (default
type).
When I double-click on one of the rows in this NSTableView, the
textfield is selected and is ready to accept keystroke which is correct
but the textShouldBeginEditing is not called for the NSTableView
delegate. This method is called as soon as I type on the keyboard.
I thought that since the textfield is selected, it is the first
responder. It seems it's not the case.
So is there a delegate method to be warmed that the text field is ready
to accept keystroke ?