Re: NSLayoutManager question
Re: NSLayoutManager question
- Subject: Re: NSLayoutManager question
- From: Douglas Davidson <email@hidden>
- Date: Thu, 6 Feb 2003 09:34:09 -0800
On Wednesday, February 5, 2003, at 07:20 PM, Koen van der Drift wrote:
However, there is one thing that is not working. I also use temporary
attributes to hilight certain characters in the string. This works well
when the string is not being edited. The problem comes when I
add/remove
characters. I respond to the notification
NSTextStorageDidProcessEditingNotification to update the attributes of
the
text. It turns out that the layoutmanager has not been informed yet at
this
point that the textstorage has changed. So adding attributes end up at
the
wrong characters.
One possibility would be to use a custom layout manager subclass and
override the actual method that the text storage calls to notify the
layout manager, first calling super and then doing your additional
work. (The method is
textStorage:edited:range:changeInLength:invalidatedRange:.) I don't
think there is any specific notification indicating that the layout
manager has been informed of changes.
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.