intercepting input in NSTextView
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.