nanochrome
nanochrome

Reputation: 727

Drawing a rounded cornered NSTextFieldCell

My code for my NSTextFieldCell is:

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
    // Drawing code here.
    NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:[NSColor lightGrayColor] endingColor:[NSColor grayColor]];
    [gradient drawInRect:cellFrame angle:90];
    [[self title] drawInRect:cellFrame withAttributes:nil];

}

I would like to have the NSTextFieldCell to have rounded corners.... how could I do this?

Upvotes: 1

Views: 1861

Answers (1)

Jac
Jac

Reputation: 46

Use the layer property of NSView, then you can set a corner radius for this.

Upvotes: 3

Related Questions