Re: Simple Semi-Transparent View?
Re: Simple Semi-Transparent View?
- Subject: Re: Simple Semi-Transparent View?
- From: Steve <email@hidden>
- Date: Fri, 22 Nov 2002 11:26:56 +0000
Apologies, I can see how my description gave the wrong impression:
In IB, for example, when you drag a custom view on to a window it shows
you your view as a light-blue semi-transparent box. That's exactly what
I wanted to achieve, but for real, and in a color of my choice.
However, thanks to starman, this works:
[NSColor setIgnoresAlpha:NO];
NSRectFillUsingOperation(visRect, NSCompositeSourceOver);
Steve
On Friday, November 22, 2002, at 10:34 AM, Kris Amico wrote:
There is a custom window sample at the Apple site, which you may need
if you
need to have an unusual shape. However, if you just need some
transparency,
could you not [myWindow setAlphaValue:]?
On 11/22/02 1:53 AM, "Steve" <email@hidden> wrote:
I'm trying to create a colored semi-transparent square area within a
window.
I'm creating a custom view, and then NSRectFill-ing the entire box
with a color whose opacity is set to 0.5,
in the hope that I can get the default gray/white lines of the window
to show through.
I thought the problem might be that the window beneath (i.e. the
superview) is not opaque.
If this is the problem, it seems I have to subclass the window just so
I can override the isOpaque method.
Or is there just a much better way to achieve the desired result?
I know that NSBox can give you a light-gray semi-transparent box,
and,
I can replace the contents with a solid color. But obviously, neither
of these give me custom-color semi-transparency.
Thanks
Steve
_______________________________________________
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.
--
Kris Amico <email@hidden>, AIM: Kris Amico
Senior Software Engineer
Macintosh Client Software Development
EarthLink, Inc.
_______________________________________________
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.