Re: NSBox Colored Background
Re: NSBox Colored Background
- Subject: Re: NSBox Colored Background
- From: August Trometer <email@hidden>
- Date: Tue, 26 Oct 2004 15:51:41 -0500
That did the trick!
For those who want to try this, I had to make the newRect dimensions
quite a bit smaller for the path fill, but it looks great.
Thanks Michael!
On Oct 26, 2004, at 2:49 PM, Michael Becker wrote:
The problem is, that drawRect: is supposed to be able to draw a
certain part of the view, i.e. the one specified by aRect. Now when
you e.g. click a button which is in your box, it tells its superview
(your custom box) to draw the rectangle where the button lies in. But
because you fit a certain shape into that rectangle, you're not
completely filling the buttons rectangle, which results in parts of
the background showing through.
Here's a possible solution to your problem:
- (void) drawRect: (NSRect) aRect
{
aRect = [ self bounds];
NSRect newRect;
[ . . . ]
This way you always draw the entire box instead of the passed
rectangle. This is theoretically slower because you always draw the
whole thing, but it should not bother you, unless your box gets
really(!) big and holds a lot of stuff... :-)
_______________________________________________
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