开发者

how to rotate an nscell

开发者 https://www.devze.com 2023-01-14 11:10 出处:网络
I am making a subclass of the NSLevelIndicatorCell and I want to draw it vertically. This doesn\'t work, what am I doing wrong?

I am making a subclass of the NSLevelIndicatorCell and I want to draw it vertically. This doesn't work, what am I doing wrong?

- (void)drawWithFrame:(NSRect)c开发者_如何学CellFrame inView:(NSView *)controlView{
[[NSGraphicsContext currentContext] saveGraphicsState];
NSAffineTransform *transform = [NSAffineTransform transform];
[transform rotateByDegrees:90];
[transform concat];
[super drawWithFrame:cellFrame inView:controlView];
[[NSGraphicsContext currentContext] restoreGraphicsState];}


[self setBoundsRotation:90];

[self setNeedsDisplay];

Now, I just need to figure out how to get the resizable edges to change from horizontal to vertical...

0

精彩评论

暂无评论...
验证码 换一张
取 消