FROM : Douglas Davidson
DATE : Thu Jan 10 20:32:21 2008
On Jan 10, 2008, at 11:28 AM, Ivan C Myrvold wrote:
> OK, I did follow your advice, and tried
>
> NSMutableAttributedString *astr = [oattributedTextView textStorage];
> [astr replaceCharactersInRange:elementRange withString:[te c]];
>
> where oattributedTextView is the outlet of the NSTextView.
>
> Now, I got the change immediately shown in my NSTextView.
Be sure to read the text system documentation on working with the text
storage. There are a number of useful things to note--for example,
multiple changes can be grouped for efficiency by surrounding them
with beginEditing/endEditing calls. If your text view is editable and
you wish your changes to participate in undo etc. alongside other user
changes, you need to notify the text view with should-change/did-
change calls.
Douglas Davidson
DATE : Thu Jan 10 20:32:21 2008
On Jan 10, 2008, at 11:28 AM, Ivan C Myrvold wrote:
> OK, I did follow your advice, and tried
>
> NSMutableAttributedString *astr = [oattributedTextView textStorage];
> [astr replaceCharactersInRange:elementRange withString:[te c]];
>
> where oattributedTextView is the outlet of the NSTextView.
>
> Now, I got the change immediately shown in my NSTextView.
Be sure to read the text system documentation on working with the text
storage. There are a number of useful things to note--for example,
multiple changes can be grouped for efficiency by surrounding them
with beginEditing/endEditing calls. If your text view is editable and
you wish your changes to participate in undo etc. alongside other user
changes, you need to notify the text view with should-change/did-
change calls.
Douglas Davidson
| Related mails | Author | Date |
|---|---|---|
| Ivan C Myrvold | Jan 10, 18:11 | |
| Douglas Davidson | Jan 10, 18:28 | |
| Jonathan Dann | Jan 10, 19:23 | |
| Ivan C Myrvold | Jan 10, 20:28 | |
| Douglas Davidson | Jan 10, 20:32 |






Cocoa mail archive

