Re: white screen windows at first
Re: white screen windows at first
- Subject: Re: white screen windows at first
- From: vincent habchi <email@hidden>
- Date: Thu, 29 Apr 2010 09:47:59 +0200
Le 28 avr. 2010 à 20:29, Bill Appleton a écrit :
> this appears to only work from inside the drawRect routine, if i get here from some other event it doesn't work
>
> so is it "legal" to draw on an NSWindow from some other event?
> if not, what the heck does QDEndCGContext do that makes it work?
If I remember correctly what David Duncan said here a while ago, graphics rendering in Core graphics, and maybe also in Cocoa, is heavily dependent on the Run loop. Normally, when you want to recache and redraw a layer, you set needsDisplay to YES (or just call - setNeedsDisplay: on a CALayer), and -drawRect or -drawInContext: gets called when the current event finishes and the Run loop regains control. I am not sure it is legal to draw outside this window. That's why if you want to redraw in background under the control of a "display" thread, that thread must set up a run loop of its own, or nothing gets drawn at all.
Vincent_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden