FROM : Nebagakid
DATE : Tue Jan 21 22:35:02 2003
What I am looking for, for example, is a way to take the entire
contents of an NSTextView (with different colors, fonts, even
pictures) and be able to put that into one string with just saying "I
want this variable to be equal to the Rich Text of this Text View" ....
Am I talking crazy here (I am really new at Cocoa) ?
-Danny Cohen
On Tuesday, January 21, 2003, at 01:20 PM, Douglas Davidson wrote:
>
> On Tuesday, January 21, 2003, at 04:46 AM, Nebagakid wrote:
>
>> Let's say I wanted to set this nice Text-View to some Rich Text with
>> different colors, fonts, and some text in the center, some on the
>> left (Second day on the job here with Cocoa).. how can I do all this
>> in one string that could be moved around easily? Like, there would be
>> text on screen, and all that would be necessary is for the Program to
>> get the Text and keep the formatting.
>
> I'm not sure I understand what you are after, but the basic styled
> text object in Cocoa is the attributed string. See the documentation
> for the classes NSAttributedString and NSMutableAttributedString for
> more information. This is complicated a bit by the fact that
> NSAttributedString itself is defined in Foundation, but most of the
> interesting attributes (font, color, etc.) are defined in the AppKit,
> so there is a separate NSAttributedString.h header in the AppKit that
> you will want to look at as well.
>
> When you are dealing with a text view, you should remember that the
> underlying text is stored in an NSTextStorage. This is a subclass of
> NSMutableAttributedString, with the additional behavior of notifying
> its associated objects (via NSLayoutManager) when it changes.
>
> Douglas Davidson
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Tue Jan 21 22:35:02 2003
What I am looking for, for example, is a way to take the entire
contents of an NSTextView (with different colors, fonts, even
pictures) and be able to put that into one string with just saying "I
want this variable to be equal to the Rich Text of this Text View" ....
Am I talking crazy here (I am really new at Cocoa) ?
-Danny Cohen
On Tuesday, January 21, 2003, at 01:20 PM, Douglas Davidson wrote:
>
> On Tuesday, January 21, 2003, at 04:46 AM, Nebagakid wrote:
>
>> Let's say I wanted to set this nice Text-View to some Rich Text with
>> different colors, fonts, and some text in the center, some on the
>> left (Second day on the job here with Cocoa).. how can I do all this
>> in one string that could be moved around easily? Like, there would be
>> text on screen, and all that would be necessary is for the Program to
>> get the Text and keep the formatting.
>
> I'm not sure I understand what you are after, but the basic styled
> text object in Cocoa is the attributed string. See the documentation
> for the classes NSAttributedString and NSMutableAttributedString for
> more information. This is complicated a bit by the fact that
> NSAttributedString itself is defined in Foundation, but most of the
> interesting attributes (font, color, etc.) are defined in the AppKit,
> so there is a separate NSAttributedString.h header in the AppKit that
> you will want to look at as well.
>
> When you are dealing with a text view, you should remember that the
> underlying text is stored in an NSTextStorage. This is a subclass of
> NSMutableAttributedString, with the additional behavior of notifying
> its associated objects (via NSLayoutManager) when it changes.
>
> Douglas Davidson
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Nebagakid | Jan 21, 13:46 | |
| Douglas Davidson | Jan 21, 19:20 | |
| Nebagakid | Jan 21, 22:35 | |
| Douglas Davidson | Jan 21, 22:46 | |
| Chris Hanson | Jan 21, 22:48 | |
| j o a r | Jan 21, 23:17 | |
| Nebagakid | Jan 21, 23:20 | |
| Nebagakid | Jan 22, 00:26 | |
| Nebagakid | Jan 22, 04:17 | |
| j o a r | Jan 22, 07:01 |






Cocoa mail archive

