• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSGraphicsContext restore crashes my xtension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSGraphicsContext restore crashes my xtension
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: quit external application
  • Next by Date: Re: Any actor or coroutine implementations for Cocoa?
  • Previous by thread: Re: NSGraphicsContext restore crashes my xtension
  • Next by thread: Re: NSGraphicsContext restore crashes my xtension
  • Index(es):
    • Date
    • Thread