Re: Style management in NSTextView
Re: Style management in NSTextView
- Subject: Re: Style management in NSTextView
- From: matt neuburg <email@hidden>
- Date: Fri, 28 May 2004 07:08:33 -0700
On Fri, 28 May 2004 06:27:50 +0200, Jean-Denis Muys <email@hidden> said:
>
Hi,
>
>
There are two related, but different things I want to do in an
>
NSTextView. And I am getting lost in the complexity of the text system.
>
>
The first is to programmatically change some text attributes to some
>
substring in the NSTextView, namely I want to make it bold, change its
>
size and color.
Size is a feature of an NSFont. Boldification is a font "trait", meaning it
is a feature of an NSFont too, but you access it by way of the NSFontManager
(part of whose job is to add and remove traits from a given font). Font is a
feature of an NSAttributedString. Color is a feature of an
NSAttributedString.
>
The second is to append (or insert) an NSMutableAttributedString to the
>
NSTextView, with all its attribute qualities, But the appendString:
>
method takes an NSString, and I could not find a similar method which
>
would take an NSAttributedString.
An NSTextView has an NSTextStorage which is an NSMutableAttributedString.
<file:///Developer/Documentation/Cocoa/Conceptual/TextStorageLayer/Concepts/
StorageLayer.html>
m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide! NOW SHIPPING...! (Finally.)
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.