Re: using the text system to implement styles
Re: using the text system to implement styles
- Subject: Re: using the text system to implement styles
- From: Todd Ransom <email@hidden>
- Date: Wed, 6 Jul 2005 14:59:15 -0600
On Jul 6, 2005, at 1:39 PM, Douglas Davidson wrote:
Alternatively, you could use a custom text storage subclass, that
would store only your custom attributes, but would synthesize the
corresponding standard attributes in response to any inquiry. You
would need to make sure to invalidate layout in the layout manager
for the appropriate ranges, however.
Thanks for replying, Douglas.
If I understand you correctly, I can just subclass NSTextStorage
rather than messing with drawing code. Whenever a request comes in
for a range with a style attribute attached I would return an
attributed string with the appropriate attributes. One more question.
Can I prevent the storage of standard attributes in the NSTextStorage
subclass just by overriding setAttributes:range: to not store them in
the underlying attributed string? Or will this approach cause me
other problems?
Thanks,
TR
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden