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;
}
...
Thanks to all those who responded to my original post. Hopefully
this will help someone else down the road.
->Ben
--
Ben Lachman
Acacia Tree Software
http://acaciatreesoftware.com
[EMAIL PROTECTED]
740.590.0009
On Mar 5, 2008, at 4:22 PM, Ben Lachman wrote:
displayIfNeededIgnoringOpacity goes back up the view hierarchy
looking for an opaque superview to start drawing with. Doing so was
causing an infinite drawing loop. I'm pretty sure this is because
you're not really supposed to be calling setNeedsDisplay...: and
displayIfNeeded...: within your drawRect: method. In any case it
was a nasty hack to get correct looking functionality and I'm
actually more interested in figuring out what is causing the double
drawing than hack a fix on top of it.
On Mar 3, 2008, at 5:38 AM, Uli Kusterer wrote:
Am 29.02.2008 um 20:55 schrieb Ben Lachman:
[self displayIfNeededIgnoringOpacity];
Is there a particular reason why you're calling this method?
Won't plain old -displayIfNeeded do the job?
_______________________________________________
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]