Re: Strange behaviour of text insertion in NSTextView
Re: Strange behaviour of text insertion in NSTextView
- Subject: Re: Strange behaviour of text insertion in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Mon, 19 Apr 2004 09:40:51 -0700
On Apr 19, 2004, at 8:26 AM, Jeremy Dronfield wrote:
I have a text view which allows the user to insert text directly from
a file. It's done very simply:
fileText = [[NSAttributedString alloc] initWithPath:fromPath
documentAttributes:NULL];
[textView insertText:fileText];
The strange behaviour is this: when the source file at fromPath is in
MS Word doc format, the insertion dirties the document and can be
undone, but when the source is rtf or rtfd, it slips past the text
view's undo manager completely unobserved. The document stays clean,
and the insertion can't be undone. Has anyone else come across this
behaviour, and can anyone explain it?
I don't have an explanation offhand, but I can tell you that
insertText: is intended as the funnel point for user typing, and its
behavior is not likely to be appropriate for any other use.
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.