Re: Transparency in NSButtonCell
Re: Transparency in NSButtonCell
- Subject: Re: Transparency in NSButtonCell
- From: Matt Ball <email@hidden>
- Date: Sat, 16 Jul 2005 19:33:55 -0400
Yeah, I thought about that. I came to the conclusion that I will never
have an object that overlaps both the titlebar and the content area,
so it's not a major concern to me.
- Matt Ball
On 7/16/05, Andreas Mayer <email@hidden> wrote:
>
> Am 17.07.2005 um 00:55 Uhr schrieb Matt Ball:
>
> > Rather than retooling my setup to include [self path] and [self
> > setPath:], is there any reason this wouldn't work: (because when I use
> > it, nothing is drawn...)
> >
> > - (void)drawRect:(NSRect)rect {
> > if(!roundRectHasBeenFilled) {
> > [self drawRoundRectWithFrame:[self bounds]];
> > }
> > }
>
> Yes, there is. You simply don't draw anything except for the first
> time drawRect: is called.
>
> Also, drawRect: might be called frequently, so you should try to
> minimize the work done there. Why create and destroy all those
> objects (colors, shadows, bezier paths ...) over and over again when
> they will stay the same as long as the window's size does not change.
>
> > if(rect.origin.y <= 19)
> > [[NSColor colorWithCalibratedWhite:0.2 alpha:0.7] set];
> > else
> > [[NSColor colorWithCalibratedWhite:0.05 alpha:0.7] set];
> > NSRectFill(rect);
>
> I don't think this will work in all situations.
>
> What if rect is something like {0, 12, 200, 50}?
>
>
> Andreas
> _______________________________________________
> 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
>
_______________________________________________
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