Re: Color of string with link attribute
Re: Color of string with link attribute
- Subject: Re: Color of string with link attribute
- From: Jeremy Dronfield <email@hidden>
- Date: Thu, 17 Jun 2004 09:41:56 +0100
If you're coding for 10.3, you can subclass NSTextView and override
-linkTextAttributes. Return an empty dictionary if you want the linked
text to have whatever style attributes you dictate when you create the
link, or return a dictionary containing the attributes you want all
your links to have. Or a mixture of both. For example, I have an
application which colour-codes hyperlinks according to whether they're
file:, http: or local in-application links. The
NSForegroundColorAttributeName is applied to the text when the link is
created, and -linkTextAttributes returns [NSDictionary
dictionaryWithObject:[NSCursor pointingHandCursor]
forKey:NSCursorAttributeName], which is common to all hyperlinks.
Regards,
-Jeremy
===================================
SkoobySoft, home of viJournal
email: email@hidden or visit:
http://freespace.virgin.net/jeremy.dronfield/skoobysoft.html
===================================
On 17 Jun 2004, at 12:12 am, Nils Hjelte wrote:
When you add the attribute NSLinkAttributeName to a attributed string
it becomes blue (and underlined) no matter what color is chosen using
NSForegroundColorAttributeName. Is there some way to override the
default link color? Could someone tell me if this is a designed
restriction (and why so) or if it is a bug?
// Nils Hjelte
[demime 0.98b removed an attachment of type
application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.
_______________________________________________
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.