NSTextView insertText & undo
NSTextView insertText & undo
- Subject: NSTextView insertText & undo
- From: Glen Simmons <email@hidden>
- Date: Thu, 26 May 2005 16:58:50 -0500
I'm "translating" keys that are entered in an NSTextView subclass
into images by:
1. catching the key in -[MyTextView keyDown:]
2. creating an NSAttributedString with an NSTextAttachment
3. calling:
[myTextView shouldChangeTextInRange:[myTextView
rangeForUserTextChange] replacementString:nil]
[myTextView insertText:theAttrStr];
[myTextView didChangeText];
This works fine, except that undo doesn't work in one particular
case: After entering one or more characters, I hit backspace once and
then try to undo. Undo appears to do nothing. My guess is that the
backspace is getting missed by the undo manager, so it's undoing what
it thinks is the last action, the insertion of the character, which
gives the same result as the undo, so it looks like nothing happened.
So, what am I missing?
Thanks,
Glen
_______________________________________________
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