On 14.03.2008, at 09:11, Ben Lachman wrote:
I think I finally solved this while chatting with Wil Shipley earlier this evening. Wil mentioned sometimes needing to display from the opaque ancestor which is basically what I was trying to do with the code Uli questioned. The way I was doing it was only partially successful at best. Given Wil's hints, I added the following to my drawing code and my drawing glitches are no more:

- (void)drawRect:(NSRect)rect {
        static BOOL toggle = YES;
        
        if( toggle ) {
                toggle = NO;
                [[self opaqueAncestor] display];
                return;
        } else {
                toggle = YES;
        }
...


I think you're supposed to call display outside of drawRect, not inside. What you're doing here is requesting the OS to draw everything twice, once with toggle YES, once with toggle NO. Only your view doesn't draw as long as toggle is YES.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to