Re: See-through custom NSView
Re: See-through custom NSView
- Subject: Re: See-through custom NSView
- From: Andreas Mayer <email@hidden>
- Date: Thu, 20 Jul 2006 00:22:34 +0200
Am 19.07.2006 um 16:40 Uhr schrieb Andreas Mayer:
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithCalibratedRed:0.f green:0.5f blue:0.f alpha:
0.5f] set];
NSRectFill(rect);
}
In case someone got the impression it was somehow necessary to fall
back to NSRectFill - here is how to do the same using NSBezierPath:
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithCalibratedRed:0.f green:0.5f blue:0.f alpha:0.5f]
set];
[[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeCopy];
[[NSBezierPath bezierPathWithRect:rect] fill];
}
I just thought NSRectFill was the simpler solution in this case. :)
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden