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 protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]