Re: Window transparency
Re: Window transparency
- Subject: Re: Window transparency
- From: Rob Abernathy <email@hidden>
- Date: Thu, 5 Feb 2004 09:59:49 +0000
Since I joined this list to have this very question answered, I guess
I'll answer.
You need to put a custom view in your window where you want the
transparency. Then for the window that you are going to want the
transparent part you need
- (void)windowControllerDidLoadNib:(NSWindowController *) aController {
....
[documentWindow setAlphaValue:0.999f];
[documentWindow setOpaque: NO]; // Not sure this is needed
....
}
or something equivalent.
Then in the drawRect for your view you need to:
-(void) drawRect:(NSRect)frame {
...
//Clear the background
[[NSColor clearColor] set];
NSRectFill([self frame]);
...
}
Then draw whatever you want to be transparent at the transparency you
want.
Rob
On 4 Feb 2004, at 11:19 pm, Johan Kool wrote:
Hello,
I'd like to make my window's background transparent but keep the
drawing in it at full opaqueness. Also the titlebar and resize widget
I'd like to keep in the normal state. The only thing I could find now
was [myWindow setAlphaValue:float]. The problem is that this
alphavalue will be used for my entire window, so that my view,
titlebar and everything is transparent too.
Terminal.app can do what I want, so I should be able to do so too. Any
pointers, clues?
Thanks again!
Johan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.