Re: Drawing a custom NSTabView Border
Re: Drawing a custom NSTabView Border
- Subject: Re: Drawing a custom NSTabView Border
- From: "Mr. Gecko" <email@hidden>
- Date: Sat, 18 Sep 2010 12:57:36 -0500
If I received it, yes. I only get the digests and I hardly ever read them, so they have to reply to all for me to receive them, sorry about that. Doing from bounds appears to fix it. I actually never knew about the draw rect doing only a section of the view. I just always thought it drew the whole thing over again. I guess if you get the math right, it could be used to improve performance of drawing.
Thanks, the current code is below.
- (void)awakeFromNib {
[self setTabViewType:NSNoTabsNoBorder];
[self setDrawsBackground:NO];
}
- (void)drawRect:(NSRect)frameRect {
NSRect bounds = [self bounds];
float lineSize = 2.0;
float transparency = 0.87;
NSBezierPath *strokePath = [NSBezierPath bezierPathWithRect:bounds];
[strokePath setLineWidth:lineSize];
NSBezierPath *path = [NSBezierPath bezierPathWithRect:bounds];
[[NSColor colorWithCalibratedWhite:1.0 alpha:transparency] set];
[path fill];
[[NSColor colorWithCalibratedWhite:transparency-0.3 alpha:1.0] set];
[strokePath stroke];
[super drawRect:frameRect];
}
On Sep 18, 2010, at 12:29 PM, Kyle Sluder wrote:
> On Sep 18, 2010, at 9:40 AM, "Mr. Gecko" <email@hidden> wrote:
>
>> I was right about these lists not being useful anymore. None has done a custom Tab View border? Really?
>
> Do you plan on acknowledging Seth Willits's reply?
>
> --Kyle Sluder
_______________________________________________
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