Subclass NSTypesetter to hide characters with a certain attribute?
Subclass NSTypesetter to hide characters with a certain attribute?
- Subject: Subclass NSTypesetter to hide characters with a certain attribute?
- From: Keith Blount <email@hidden>
- Date: Fri, 23 Mar 2007 08:46:53 -0700 (PDT)
Hello,
I have a custom text attribute, KBAnnotationAttributeName, which can be applied to text in my application. My text view subclass then does some custom drawing, so that ranges of text with this attribute applied have a bubble drawn around them, and they are also displayed with temporary colour attributes (via NSLayoutManager). All of which just highlights the fact that these ranges are annotations rather than part of the main text.
However, a number of my users really want to be able to hide these annotations (understandably enough). This would make the feature pretty much akin to the way you can set a "hidden" flag to characters via the Font panel in MS Word, which can then be hidden or shown.
Having searched the archives, it seems that the best way to hide characters in this manner would be to subclass NSTypesetter. However, having searched through the docs and online I cannot find the right point at which to do this in an NSTypesetter subclass. I had hoped to find a method that would allow me to return an NSRect for a given character, so that I could return an NSZeroRect for any character with the annotation attribute if annotations are set to be hidden, but it seems it is not quite so simple. :)
Could anybody give me some pointers with where to start with this?
Many thanks in advance and all the best,
Keith
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden