Re: NSView subview backgrounds
Re: NSView subview backgrounds
- Subject: Re: NSView subview backgrounds
- From: David Duncan <email@hidden>
- Date: Mon, 1 Oct 2007 12:49:41 -0700
On Oct 1, 2007, at 11:22 AM, Twisted Theory Software wrote:
I'm not sure, I don't know what an embedding hierarchy is.
What views are subviews of what other view, etc, down the line until
you reach a window. You can check this in Interface Builder by
putting the nib in list view and looking at what views are contained
by what other views.
If you want to get proper drawing behavior, then the buttons need to
be contained by the view that is drawing the background.
When drawing a subview with a transparent background, why does the
white colour, set with
[[NSColor whiteColor] set];
[NSBezierPath fillRect:rect];
show up, and not the gradient background?
[NSColor whiteColor] has an alpha value of 1.0, therefore drawing
with it (in the default drawing mode) will obliterate what is in the
drawn area. So basically what you are saying is "fill this view's
area with white"
Actually, I looked over your code again, and the problem turns out to
be due to the way your using the rect passed into your -drawRect:
method. This rect is constrained to the area that is actually being
drawn, not the entire area of your view, but you are using it as
such. You need to change your code to either use [self bounds] or to
deal with redrawing subrects of the view instead of just the entire
view. When I modified your code to do that everything worked correctly.
--
David Duncan
Apple DTS Quartz and Printing
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden