Re: limit text input in NSTextView
Re: limit text input in NSTextView
- Subject: Re: limit text input in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Mon, 16 Sep 2002 11:23:17 -0700
On Monday, September 16, 2002, at 11:05 AM, Marco Binder wrote:
OK, I havent tried and Ondra is rarly wrong. just in case my idea is
right and only NSCells take NSFormatters, you might have to subclass
NSTextView and do nothing but override NSResponders
-(void)keyUp:(NSEvent*)event method. If the NSEvent4s
- (NSString*) characters method gives you an "allowed" character, just
pass the event to super, otherwise ignore it.
No, if you're not going to use a formatter, you can use the NSTextView
delegate method
- (BOOL)textView:(NSTextView *)textView
shouldChangeTextInRange:(NSRange)affectedCharRange
replacementString:(NSString *)replacementString;
NSTextView processes text on keyDown: rather than keyUp:, but keyDown:
is not the right place to intervene.
Douglas Davidson
_______________________________________________
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.