Re: Transparency? SOLVED
Re: Transparency? SOLVED
- Subject: Re: Transparency? SOLVED
- From: John Randolph <email@hidden>
- Date: Wed, 21 Apr 2004 12:34:31 -0700
On Apr 21, 2004, at 9:10 AM, Huyler, Christopher M wrote:
Thanks! I would have run into the isOpaque problem sooner or later and
the it hadn't even crossed my mind...
Good news, I found a solution...
NSRectFill() apparently ignores the alpha value. A work around is to
use a NSBeizerPath like so:
NSBezierPath *bp = [NSBeizerPath bezierPathWithRect:rect];
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.5] set];
[bp fill];
Thanks everyone for your help.
-----Original Message-----
From: Nicko van Someren [mailto:email@hidden]
Sent: Wednesday, April 21, 2004 12:00 PM
To: Huyler, Christopher M
Cc: J Nozzi; email@hidden
Subject: Re: Transparency?
Have you remembered to override -(BOOL)isOpaque in the NSBox subclass?
The default version returns YES but if you want anything behind your
view to be drawn reliably you'll need to override it to return NO so
that items lower down in the stack of views (such as the window
background) get drawn.
Actually, the default implementation of [NSView -isOpaque] returns NO.
-jcr
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.