Re: NSTextView insertText & undo
Re: NSTextView insertText & undo
- Subject: Re: NSTextView insertText & undo
- From: Douglas Davidson <email@hidden>
- Date: Thu, 26 May 2005 17:19:11 -0700
On May 26, 2005, at 4:59 PM, Glen Simmons wrote:
Well, the requirement I have is to translate a particular set of
characters into images and not allow any other characters. I don't
really care where I catch them, I just need to change what gets
inserted and disallow other characters. I think I was passing nil
for the replacement string because I'm not actually inserting a
string, I'm inserting the NSAttributedString/NSTextAttachment thing
and -shouldChangeTextInRange:replacementString: takes an NSString.
How should this be done so that it works nicely with keyboard
entry, paste and undo?
Often the easiest way to do this sort of thing is with a formatter,
for example on an NSTextField. However, it can be done manually;
exactly how depends on exactly what you want to do. For example,
what do you intend should happen on copy and paste?
Douglas Davidson
_______________________________________________
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