NSTextView shared state magic?
NSTextView shared state magic?
- Subject: NSTextView shared state magic?
- From: Keith Blount <email@hidden>
- Date: Sat, 9 Feb 2008 08:23:25 -0800 (PST)
Hi,
I'm in the process of putting together a "page layout" view for my app, much like the "Wrap to Page" mode in TextEdit. So far, so good. However, I have a heavily subclassed NSTextView which has certain extra features - coloured annotations, highlight colours and so forth. When a layout manager has several text containers each with an associated text view, there are certain attributes that are shared across all of those text views - whether they use the font panel, have spell-checking enabled and so forth. Is there any way to tell a text view that it should share other, custom, attributes, too? For instance, if someone creates an annotation in my text view, they can set its colour. In doing so, my text view receives a -setAnnotationColor: message so that when the user creates another annotation, it will assume the colour they last used. When I have multiple text views, however, only the current text view receives this message, so that if the user creates
an annotation on another "page", it uses the colour last used on that page rather than the colour last used in the document.
What's the best way of getting other text views that use the same layout manager to share custom attributes as set in the -firstTextView? (Or do I have to do it all manually?)
Thanks in advance and all the best,
Keith
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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