• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: limit text input in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: limit text input in NSTextView
      • From: Arthur Clemens <email@hidden>
    • Re: limit text input in NSTextView
      • From: Arthur Clemens <email@hidden>
    • Re: limit text input in NSTextView
      • From: Marco Binder <email@hidden>
References: 
 >Re: limit text input in NSTextView (From: Marco Binder <email@hidden>)

  • Prev by Date: Re: limit text input in NSTextView
  • Next by Date: Re: limit text input in NSTextView
  • Previous by thread: Re: limit text input in NSTextView
  • Next by thread: Re: limit text input in NSTextView
  • Index(es):
    • Date
    • Thread