Re: controlTextDidChange, backspace possible?
Re: controlTextDidChange, backspace possible?
- Subject: Re: controlTextDidChange, backspace possible?
- From: j o a r <email@hidden>
- Date: Tue, 14 Sep 2004 22:57:07 +0200
On 2004-09-14, at 21.03, John Tsombakos wrote:
Well I solved the problem of the delegate not being called. It has to
be named:
-(BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText
*)textObject
If you want the convenience that the standard delegate callback methods
provide (without having to sign up for the corresponding notifications
manually), it's kind of obvious that you need to get the method names
exactly right.
Then it gets called. But not consistantly. I added a second text field
to the window, to have something to tab between. It gets called the
for the first character I type into the field, but not for subsequent
ones. If I tab out and back it gets called for the first key again.
Well, it's "shouldBeginEditing" after all... Not should *shouldAllow*
or *shouldContinue* or anything like that.
I was just trying a simple solution - looks like more work to limit
the number of characters. I'll keep an eye on the thread for the
eventual solution.
I have already posted a solution to this thread (*), how about trying
it out?
j o a r
*) With the minor problem that Peter noted that the cursor position is
shifted forward if you replace the string like I suggested. This can be
fixed, but I'm not sure if it's worth the trouble. It depends on the
application I guess.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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