Re: Cocoa Drawing
Re: Cocoa Drawing
- Subject: Re: Cocoa Drawing
- From: Alex Kac <email@hidden>
- Date: Mon, 4 May 2009 12:57:00 -0500
On May 1, 2009, at 5:20 AM, DairyKnight wrote:
I'm trying to build a simple scribble program with Cocoa, and got
some
questions I couldn't solve. Hope someone here could help.
1. How can I perform a proper drawing in somewhere else rather than
drawRect: ? Like the Win32 GetDC(HWND) and ReleaseDC. (Sorry I'd use
lots of
Win32 analogy, coz
I've been a Win32 developer for quite a while.)
Create an ivar context, draw your stuff in there. Then call
setNeedsDisplay on the view and draw the contents of the context in
drawRect.
Even in Win32 you are supposed to do the drawing only in WM_PAINT, not
just anytime you want.
Alex Kac - President and Founder
Web Information Solutions, Inc.
"If at first you don't succeed, skydiving is not for you."
-- Francis Roberts
_______________________________________________
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