How to change color of divider in NSSplitView?

Posted by Akki on Stack Overflow See other posts from Stack Overflow or by Akki
Published on 2012-06-05T08:45:55Z Indexed on 2012/06/13 4:40 UTC
Read the original article Hit count: 860

Filed under:
|
|
|

Can we change the color of the divider? Apple documentations says, that we can override -dividerColor in subclass of NSSplitView for this, but it doesn't works for me, or my understanding isn't correct. Also I've try create color layer over divider, e.g.:

colorLayer = [CALayer layer];
NSRect dividerFrame = NSMakeRect([[self.subviews objectAtIndex:0] frame].size.width, [[self.subviews objectAtIndex:0] frame].origin.y, [self dividerThickness], self.frame.size.height);

[colorLayer setBackgroundColor:[color coreGraphicsColorWithAlfa:1]];
[colorLayer setFrame:NSRectToCGRect(dividerFrame)];

[self.layer addSublayer:colorLayer];

Not works.

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about xcode4