• 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
intercepting input in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

intercepting input in NSTextView


  • Subject: intercepting input in NSTextView
  • From: Koen van der Drift <email@hidden>
  • Date: Sat, 1 Feb 2003 16:19:49 -0500

Hi,

A NSTextView in my app uses some special layout for the text, basically the
letters are displayed in groups of 10 characters. So what I thought of to
do is each time the text is edited, iterate over the string and add a space
after every 10th character, and then display it.

What is the recommended method to 'intercept' the editing so I can change
the text *before* it gets displayed? I though about using -

(BOOL)textView:(NSTextView *)aTextView
shouldChangeTextInRange:(NSRange)affectedCharRange
replacementString:(NSString *)replacementString


but changing the replacementstring doesn't change the displayed text.

I also tried insertText, but that only works for keyboard input, not for
copy/paste.


Any suggestions where to do this?


thanks,

- Koen.
_______________________________________________
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.

  • Prev by Date: Re: including library in .app
  • Next by Date: Re: including library in .app
  • Previous by thread: Re: NSArray problems
  • Next by thread: HI Guidelines: rounded text fields
  • Index(es):
    • Date
    • Thread