> Probably wherever you do the -setNeedsDisplay: for the view would be about 
> right... ;-)

Unfortunately that's not a good place either - the window's shadow
needs to be invalidated after the drawing actually occurs, not just
when the dirty flag is set.

Instead of -setNeedsDisplay:, I think your best bet is:

    [[cView window] display];
    [[cView window] invalidateShadow];

Or if you can target Snow Leopard, I remember seeing some 'NSView did
draw' delegate methods...

> I see that the end of drawRect: is indeed a bad place to do it.  The app's
> CPU % use jumps from ~1% to 2%~3%.  I'll have a play/think about where to do
> it.  Maybe in the custom window class or the app delegate.

I don't think you're going to be able to avoid the increased CPU
usage. Invalidating the window's shadow forces it to redraw, which
inevitably will cost some CPU cycles - there's no way around that; it
doesn't matter where you actually tell it to invalidate the shadow.
_______________________________________________

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 arch...@mail-archive.com

Reply via email to