CALayer graphics context

2008-10-22 Thread DKJ
Is there a quick way to get a CGContextRef for a CALayer? I don't see anything obvious in the documentation for the CALayer class. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: CALayer graphics context

2008-10-22 Thread Patrick Mau
Hi dkj A CALayer itself is not associated with a context. The NSView owns the graphics context. The context you are looking for is passed to the drawLayer:inContext message. Simply set a delegate of your layer and send 'setNeedsDisplay' once to setup your content. Here's an example: -

Re: CALayer graphics context

2008-10-22 Thread David Duncan
On Oct 22, 2008, at 8:00 AM, Patrick Mau wrote: A CALayer itself is not associated with a context. The NSView owns the graphics context. Actually when your in layer backing mode, the CALayer owns the graphics context. The context you are looking for is passed to the drawLayer:inContext