Re: See-through custom NSView
Re: See-through custom NSView
- Subject: Re: See-through custom NSView
- From: Stephane <email@hidden>
- Date: Wed, 19 Jul 2006 16:46:56 +0200
Actually, it does:
---------8<------------8<-----------8<------------8<-----------8<-------
-----
#import "ViewDock.h"
@implementation ViewDock
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
}
return self;
}
- (void) dealloc
{
[super dealloc];
}
#pragma mark drawing
- (void)drawRect:(NSRect)rect
{
[[NSColor clearColor] set];
NSRectFill(rect);
}
- (BOOL)isOpaque
{
return NO;
}
@end
---------8<------------8<-----------8<------------8<-----------8<-------
-----
On Jul 19, 2006, at 3:45 PM, Michael Lutz wrote:
Hello Stephane,
this won't do the trick. Thanks for the suggestion anyway.
ClearColor sounded good to me until I tried it ;-).
I probably wasn't clear ;-) enough on what I want to achieve.
Therefore I compiled a little sample project. The result looks like
this:
<Picture 1.png>
The top view is a NSTextview, and as you can see, it is transparent
(you can see XCode behind it). The bottom view is my custom view
(ViewDock) which I can't get this transparent as the NSTextView. If
you (anybody) likes to give it a try, please take a look at the
attached project.
<ClearView.zip>
Cheers,
Michael
On 19.07.2006, at 15:00, Stephane wrote:
Use the clearColor.
On Jul 19, 2006, at 2:30 PM, Michael Lutz wrote:
http://developer.apple.com/samplecode/RoundTransparentWindow/
index.html
-jcr
Hi John,
thanks for the hint, I know that example. Unfortunately that's
not what I want: It uses a complete transparent window (setting
the alpha of the whole window). I only want the area which my
view covers to be transparent (like a whole in the window so to
speak). This can be achieved using a NSTextView, bat I can't
accomplish it using a custom (NSView derived) view.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden