Drawing a custom NSTabView Border
Drawing a custom NSTabView Border
- Subject: Drawing a custom NSTabView Border
- From: Mr.Gecko <email@hidden>
- Date: Fri, 17 Sep 2010 17:29:37 -0500
Hello I'm wondering what will be the best way to draw a custom NSTabView Border. I have tried many things and it always ends up that I fail. The border gets drawn, but the objects in the Tab View, if you focus them, has a black edge around them, that is not elegant at all. Is there any examples on the internet that I could look at? This is my code below.
- (void)awakeFromNib {
[self setTabViewType:NSNoTabsNoBorder];
[self setDrawsBackground:NO];
}
- (void)drawRect:(NSRect)frameRect {
float lineSize = 2.0;
float transparentcy = 0.87;
NSBezierPath *strokePath = [NSBezierPath bezierPathWithRect:frameRect];
[strokePath setLineWidth:lineSize];
NSBezierPath *path = [NSBezierPath bezierPathWithRect:frameRect];
[[NSColor colorWithCalibratedWhite:1.0 alpha:transparentcy] set];
[path fill];
[[NSColor colorWithCalibratedWhite:transparentcy-0.3 alpha:1.0] set];
[strokePath stroke];
[super drawRect:frameRect];
}
Thanks for any help,
Mr. Gecko_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden