Re: controlTextDidChange, backspace possible?
Re: controlTextDidChange, backspace possible?
- Subject: Re: controlTextDidChange, backspace possible?
- From: John Tsombakos <email@hidden>
- Date: Tue, 14 Sep 2004 13:53:11 -0400
> From: "Peter Karlsson" <email@hidden>
> Subject: Re: controlTextDidChange, backspace possible?
>
> Ok, maybe this is better?
>
> if ([[myTexfieldOutlet stringValue] length] < 33)
>
> But I still have the problem with my moving cursor.
>
> Peter
I checked the documentation for NSTextField and there is a delegate message:
- (BOOL)shouldBeginTextEditing:(NSText *)textObject
I set up a simple XCode project with an NSTextField in a window, and set it's delegate to my custom Controller object. In my Controller object, I implemented the shouldBeginTextEditing method, but it was never called (I had an NSLog in there). Am I missing the point of this message? (according to the docs: "If it is editable and its delegate responds to control:textShouldBeginEditing:, invokes that method and returns the result.") and the docs of NSControl's control:textShouldBeginEditing: delegate message says:
"Sent directly by control to the delegate when the user tries to enter a character in a cell of a control that allows editing of text (such as a text field or form field). Return YES if the NSControl?s fieldEditor should be allowed to start editing the text, NO otherwise."
My 2 cents, with a sample that doesn't work...
jt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden