Re: NSBox Colored Background
Re: NSBox Colored Background
- Subject: Re: NSBox Colored Background
- From: Michael Becker <email@hidden>
- Date: Tue, 26 Oct 2004 21:49:22 +0200
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... :-)
Regards,
Michael
_______________________________________________
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