• 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
NSDrawNinePartImage not working ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDrawNinePartImage not working ?


  • Subject: NSDrawNinePartImage not working ?
  • From: Sandro Noël <email@hidden>
  • Date: Mon, 15 Feb 2010 00:36:03 -0500

Ok I know I must be missing something dumb.
i'm trying to draw borders for the window,

- (void) awakeFromNib{

[window setStyleMask:NSBorderlessWindowMask];
[window setOpaque:YES];

NSDrawNinePartImage([[window contentView]frame],
									nil,
									nil,
									nil,
									[NSImage imageNamed:@"right3.png"],
									nil,
									[NSImage imageNamed:@"left3.png"],
									[NSImage imageNamed:@"right4.png"],
									[NSImage imageNamed:@"left5.png"],
									[NSImage imageNamed:@"left4.png"],
									 NSCompositeClear,
									1.0,
									NO);


but i get an error on runtime.
<Error>: CGContextGetStyle: invalid context 0x0
It does not make sense to draw an image when [NSGraphicsContext currentContext] is nil.  This is a programming error.
Break on _NSWarnForDrawingImageWithNoCurrentContext to debug.  This will be logged only once.  This may break in the future.
CGContextClipToRect: invalid context 0x0
<Error>: CGContextSetAlpha: invalid context 0x0
<Error>: CGContextGetUserSpaceToDeviceSpaceTransform: invalid context 0x0
<Error>: CGContextDrawTiledImage: invalid context 0x0
<Error>: CGContextClipToRect: invalid context 0x0
<Error>: CGContextSetAlpha: invalid context 0x0
<Error>: CGContextGetUserSpaceToDeviceSpaceTransform: invalid context 0x0
<Error>: CGContextDrawTiledImage: invalid context 0x0

I looked in the docsa little but did not find any indication that i had to provide a Graphics context.

any pointers ?


Sandro.



_______________________________________________

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: NSDrawNinePartImage not working ?
      • From: PCWiz <email@hidden>
    • Re: NSDrawNinePartImage not working ?
      • From: Graham Cox <email@hidden>
    • Re: NSDrawNinePartImage not working ?
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Question about zipping files
  • Next by Date: Re: NSDrawNinePartImage not working ?
  • Previous by thread: Re: Question about zipping files
  • Next by thread: Re: NSDrawNinePartImage not working ?
  • Index(es):
    • Date
    • Thread