Re: Attributed Strings, NSTextField, and NSTextView
Re: Attributed Strings, NSTextField, and NSTextView
- Subject: Re: Attributed Strings, NSTextField, and NSTextView
- From: Iain Delaney <email@hidden>
- Date: Wed, 29 Jun 2005 15:42:15 -0400
Thanks for the hint. That is the necessary call, although the
documentation isn't correct. The docs for NSTextField state that,
"You can change text attributes programmatically regardless of the
setting" , but you need to set allowsEditingTextAttributes to YES in
order to see anything. The comments for NSCell imply the same thing.
On Jun 28, 2005, at 6:43 PM, Aki Inoue wrote:
Refer to -[NSCell allowsEditingTextAttributes].
Aki
I've been investigating Attributed Strings, and how they work with
NSTextField and NSTextView, and I've got some questions I hope
someone can answer.
I want to have an attributed string in a text field, or at least
something that looks like a text field. I want to do something
that looks like syntax coloring on the input, so that certain
parts of the string are different colors. Now, I can put an
attributed string into a text field, and it looks like it supports
rich text, but it also looks like I can only set attributes for
the entire string, not parts of it. Is this correct?
I'm thinking that I might be able to use a text field, or a sub-
class of a text field with a custom formatter to achieve what I
want. The other alternative is to sub-class a text view, and make
it behave as much like a text field as possible. NSTextView seems
a lot 'heavier' though, so I'm not sure if this is a good idea.
As anyone tried anything like this in the past, and does anyone
have any suggestions on how to proceed with this?
Thanks in advance,
Iain
_______________________________________________
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
_______________________________________________
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