• 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
Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing invisible window. was Re: Forcing ordered-out-window to adjust position


  • Subject: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
  • From: Philip White <email@hidden>
  • Date: Sat, 15 May 2010 14:48:02 -0500

On May 15, 2010, at 2:31 PM, Philip White wrote:

I wrote this:

> -(void)display
> {
> 	/* seems to be unnecessary?
> 	NSGraphicsContext *context = [NSApp context];
> 	NSGraphicsContext *oldContext = [NSGraphicsContext currentContext];
> 	[NSGraphicsContext setCurrentContext:context];*/
>
> 	NSView *tv = [[self contentView] superview]; //theme view
> 	[tv lockFocus];
> 	[[NSColor clearColor] set];
> 	NSRectFill([tv bounds]);
> 	[tv unlockFocus];
>
> 	//[NSGraphicsContext setCurrentContext:oldContext];
> }
>
> -(void)displayIfNeeded
> {
> 	[self display];
> }
>
> Also, you need to call setOpaque:YES on the window.
>

And though it works, it gives various errors. On the -lockFocus method it prints out:
*** Assertion failure in -[NSThemeFrame lockFocus], /SourceCache/AppKit/AppKit-1038.25/AppKit.subproj/NSView.m:5237
2010-05-15 14:43:07.750 CocoaJunk[2204:a0f] -[NSThemeFrame(0x100418f20) lockFocus] failed with window=0x1001215a0, windowNumber=-1, [self isHiddenOrHasHiddenAncestor]=0

If you comment out the -lockFocus and -unlockFocus lines it still works but prints out:
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
and more.

Hmm...

-Philip White

_______________________________________________

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: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
      • From: Michael Ash <email@hidden>
References: 
 >Forcing ordered-out-window to adjust position (From: Philip White <email@hidden>)
 >Re: Forcing ordered-out-window to adjust position (From: Scott Ribe <email@hidden>)
 >Re: Forcing ordered-out-window to adjust position (From: Philip White <email@hidden>)

  • Prev by Date: Re: Figuring out what's causing redrawing
  • Next by Date: Re: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
  • Previous by thread: Re: Forcing ordered-out-window to adjust position
  • Next by thread: Re: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
  • Index(es):
    • Date
    • Thread