• 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
How to display NSStrokeColorAttributeName on the NSColorPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to display NSStrokeColorAttributeName on the NSColorPanel


  • Subject: How to display NSStrokeColorAttributeName on the NSColorPanel
  • From: Leonardo <email@hidden>
  • Date: Sat, 01 Feb 2014 10:37:59 +0100
  • Thread-topic: How to display NSStrokeColorAttributeName on the NSColorPanel

When my 1st NSColorWell is active and I change the selection in my
NSTextView, both NSColorWell and NSColorPanel display the foreColor of the
selected tex. That's fine.

Now I have a second NSColorWell that should display the strokeColor (or any
other color) of the selected text. But I can't yet succeed. I my NSTextView
subclass I have coded, unsuccessfully:

- (void)textViewDidChangeSelection:(NSNotification*)aNotification
{
    NSRange selRange = [self selectedRange], effRange;
    NSDictionary    *attributes = [self.textStorage
attributesAtIndex:selRange.location effectiveRange:&effRange];
    if(attributes){
        NSColor *strokeColor = [attributes
objectForKey:NSStrokeColorAttributeName];
        if(strokeColor){
            [oStrokeColorWell setColor:strokeColor];
        }
    }
}

Even if the strokeColor exists and gets set to the oStrokeColorWell, the
oStrokeColorWell still displays the foreColor. Any idea?


Regards
-- Leonardo


_______________________________________________

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


  • Next by Date: Re: Legal Opinion on GCUndoManager
  • Next by thread: Re: How to display NSStrokeColorAttributeName on the NSColorPanel
  • Index(es):
    • Date
    • Thread