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: Douglas Davidson <email@hidden>
- Date: Wed, 6 Jul 2005 14:04:42 -0700
On Jul 6, 2005, at 1:59 PM, Todd Ransom wrote:
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?
There is nothing preventing you from doing so, but I can't help
thinking that it would be better to avoid reaching the point at which
undesired attributes are being set. Someone's expectations are
likely to be dashed if setting is ignored, possibly the user's.
You will need to decide in your approach just what you will do with
standard user interface items such as a "Bold" menu item, the font
panel, color panel, etc. For each of these there is a natural point
at which you can intervene, but you will need to decide how your text
should be altered in response.
Douglas Davidson
_______________________________________________
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