Re: Unwanted transparency in custom view
Re: Unwanted transparency in custom view
- Subject: Re: Unwanted transparency in custom view
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 17 Jun 2002 13:47:02 -0700
On Monday, June 17, 2002, at 12:43 PM, Gregory Weston wrote:
Ken Tozier <email@hidden> writes:
I'm writing a custom view class and have everything working except for
one bug, when it renders it is semi transparent. I overrode "isOpaque"
to return yes and set the color alpha to 1.0 but you can still see
through it.
I may be mistaken, but I'm under the impression that overriding
isOpaque to
return YES is a performance optimization that tells the system
not to bother
redrawing the window surface because you're going to completely
overwrite
it anyway. It's not a signal that the system should somehow erase any
areas you don't explicitly draw, which it sounds like you were
expecting.
That is correct.
Basically, returning YES from -isOpaque is a promise that you'll
cover every pixel you're asked to in -drawRect:.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.