• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSLayoutManager question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSLayoutManager question
      • From: Koen van der Drift <email@hidden>
References: 
 >RE: NSLayoutManager question (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: NSConnection
  • Next by Date: Re: RTFD from a Foundation app?
  • Previous by thread: RE: NSLayoutManager question
  • Next by thread: Re: NSLayoutManager question
  • Index(es):
    • Date
    • Thread