• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView and changing the selected text's color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView and changing the selected text's color


  • Subject: Re: NSTextView and changing the selected text's color
  • From: Graham Cox <email@hidden>
  • Date: Thu, 12 Jun 2008 23:46:57 +1000

Definitely sounds like a bug - file it anyway, they can only say "behaves as expected" (and probably will... ;-)

I would expect that if I set my foreground text to some pale colour, I could set a different colour for selected text so it has contrast with the background selection colour, not just work for black text.

G.


On 12 Jun 2008, at 7:47 pm, Mattias Arrelid wrote:

Sorry for my many replies...

It turns out that if you set the NSForegroundColorAttributeName of the
attributed string in NSTextView's text storage, the call to
setSelectedTextAttributes: doesn't have any effect when called as
described below:

NSMutableDictionary *dict = [[[textView selectedTextAttributes]
mutableCopy] autorelease];
[dict setObject:[NSColor redColor] forKey:NSForegroundColorAttributeName];
[textView setSelectedTextAttributes:dict];


Setting the background color works fine though. I cannot see anything
regarding this limitation in the documentation - is it by design or is
it a bug?

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Fwd: NSTextView and changing the selected text's color (From: "Mattias Arrelid" <email@hidden>)
 >Re: NSTextView and changing the selected text's color (From: Douglas Davidson <email@hidden>)
 >Re: NSTextView and changing the selected text's color (From: "Mattias Arrelid" <email@hidden>)
 >Re: NSTextView and changing the selected text's color (From: "Mattias Arrelid" <email@hidden>)
 >Re: NSTextView and changing the selected text's color (From: "Mattias Arrelid" <email@hidden>)

  • Prev by Date: Re: Prevent Asynchronous operation of beginSheetModalForWindow
  • Next by Date: Re: argument checks
  • Previous by thread: Re: NSTextView and changing the selected text's color
  • Next by thread: Re: NSTextView and changing the selected text's color
  • Index(es):
    • Date
    • Thread