On Wed, Apr 28, 2010 at 11:29 AM, Bill Appleton
<billapple...@dreamfactory.com> 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 (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