Re: [newbie] Font attributes in NSTextView
Re: [newbie] Font attributes in NSTextView
- Subject: Re: [newbie] Font attributes in NSTextView
- From: Brian Webster <email@hidden>
- Date: Mon, 9 Sep 2002 20:20:16 -0500
On Monday, September 9, 2002, at 06:12 PM,
email@hidden wrote:
I have an NSTextView that'M addming lines to. I want some of these
lines to be bold (and perhaps in italics) and others to be plain text.
I've found out how to use NSAttributedString, but I cannot add an
attributed string to a text view.
How would I do this?
You can directly modify the text storage for the text view. Send the
view a textStorage message to get its NSTextStorage, which is a
subclass of NSMutableAttributedString. You can then use
appendAttributedString: and other such methods to tack your own stuff
on the end.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.