Re: white screen windows at first
Re: white screen windows at first
- Subject: Re: white screen windows at first
- From: Shawn Erickson <email@hidden>
- Date: Wed, 28 Apr 2010 15:41:10 -0700
On Wed, Apr 28, 2010 at 11:29 AM, Bill Appleton
<email@hidden> wrote:
> *this appears to only work from inside the drawRect routine, if i get here
> from some other event it doesn't work
Cocoa drawing is centered around doing all of your drawing under
drawRect: (or drawInContext: if using CALayers, etc.). When drawRect:
is called the environment is setup for you as needed to do drawing and
things are correctly flushed out to the window server.
You should try to follow that methodology if you can (for one using
things like setNeedsDisplay: to trigger drawRect: to be called helps
avoid over drawing).
Review...
<http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Introduction/Introduction.html>
Paul outlined a way to draw outside of drawRect: however I think it
would be better to use lockFocusIfCanDraw instead of lockFocus.
Review...
<http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaDrawingGuide/GraphicsContexts/GraphicsContexts.html#//apple_ref/doc/uid/TP40003290-CH203-SW11>
-Shawn
_______________________________________________
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