6

Do you have any idea how i can obtain that control subclassing NSSegmentedControl/NSSegmentedControlCell ? -

I've tried to override some methods from NSSegmentedControlCell, but i'm not even close to obtain what I want.

  override func drawSegment(segment: Int, inFrame frame: NSRect, withView controlView: NSView) {

        let bez = NSBezierPath(roundedRect: frame, xRadius: 3, yRadius: 3)
        NSColor.lightGrayColor().set()
        bez.stroke()
        if self.selectedSegment != segment {
            bez.fill()
    }
    //super.drawSegment(segment, inFrame: frame, withView: controlView)
}

override func drawInteriorWithFrame(cellFrame: NSRect, inView controlView: NSView) {
    //
}

drawInteriorWithFrame should let me to draw background how i want (just clearColor, with border), but still it has default lightGrayColor.

Thanks.

C-Viorel
  • 1,801
  • 3
  • 22
  • 41

0 Answers0