Attributed Strings, NSTextField, and NSTextView
Attributed Strings, NSTextField, and NSTextView
- Subject: Attributed Strings, NSTextField, and NSTextView
- From: Iain Delaney <email@hidden>
- Date: Tue, 28 Jun 2005 18:39:58 -0400
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