Re: NSGraphicsContext restore crashes my xtension
Re: NSGraphicsContext restore crashes my xtension
- Subject: Re: NSGraphicsContext restore crashes my xtension
- From: email@hidden
- Date: Sun, 27 Jul 2008 21:19:24 +0000
-------------- Original message ----------------------
From: glenn andreas <email@hidden>
>
> CG is "stateless", in that there is no "current context" (all drawing
> to a CGContext requires passing the CGContextRef). NSGraphicsContext,
> on the other hand, involves an implicit "current context". If you
> change that, you need to change it back - that's what currentContext/
> setCurrentContext does. Just because NSGraphicsContext is built on
> top of CGContextRef doesn't mean that they have the same semantics
> (nor is NSGraphicsContext "just a wrapper" - it does a few more things).
>
Thanks Glenn.
I'm still confused as to exactly how I should restore or change the context "back to the original" since the original is a CGGraphicsContext. and the only NSGraphicsContext is one I create using the passed in CGGraphicsContext. It seems like a catch-22. I can't draw the text without creating an NSGraphicsContext and I can't restore a calling NSGraphicsContext because the calling context is a CGGraphics context which doesn't work with [NSGraphicsContext setCurrentContext: nsContext];
Any pointers?
_______________________________________________
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