• 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: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef


  • Subject: Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef
  • From: vincent habchi <email@hidden>
  • Date: Fri, 9 Apr 2010 07:29:31 +0200

Adam,

> You need to have a current NSGraphicsContext for NSColor (and possibly other) attributes.  This is pretty easy, as in the following snippet from my own code:
>
>    [NSGraphicsContext saveGraphicsState];
>    [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:ctxt flipped:NO]];
>
>    CTFrameDraw(frame, ctxt);
>    CGContextFlush(ctxt);
>    CFRelease(frame);
>
>    [NSGraphicsContext restoreGraphicsState];

Nice, I must admit I hadn't think about NSGraphicsContext at all, having a valid CGContext. I'll try this. Thanks at lot!

Vincent_______________________________________________

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

References: 
 >"Toll free" bridge from NSAttributedString * to CFAttributedStringRef (From: vincent habchi <email@hidden>)
 >Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Re: Interface Builder input panel fields not updated when OK button clicked
  • Next by Date: Re: CFRunLoopStop exception
  • Previous by thread: Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef
  • Next by thread: [NSMutableArray array]
  • Index(es):
    • Date
    • Thread