Re: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
Re: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
- Subject: Re: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position
- From: Michael Ash <email@hidden>
- Date: Sat, 15 May 2010 16:14:06 -0400
On Sat, May 15, 2010 at 3:48 PM, Philip White <email@hidden> wrote:
>
> 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.
A much simpler way to make a window invisible is to simply do [window
setAlphaValue:0]. Totally supported, guaranteed to work, and extremely
easy.
Mike
_______________________________________________
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