Re: UI elements in custom view mess up drawing
Re: UI elements in custom view mess up drawing
- Subject: Re: UI elements in custom view mess up drawing
- From: Benjamin Stiglitz <email@hidden>
- Date: Tue, 14 Oct 2008 09:43:45 -0400
- Mail-followup-to: email@hidden
> When I turn off the progress indicator
> however, or when I update the string value of the text field, the drawing
> from the drawRect method above is drawn offset from its origin, instead
> drawing at the origin of either of the subviews, resulting in spurious
> lines being drawn where there should only be background (the gradient).
> (You can see a screenshot of the effect here:
> http://sintraworks.com/private/RenderingMess.png)
The rect passed to -[NSView drawRect:] is the dirty rect of the view,
not the bounds of the view. The changing subviews are dirtying your view
and then you're drawing as if that changed area was your complete frame.
Try replacing your use of rect with -[NSView bounds] instead, and then
take a look at the View Programming Guide [1].
-Ben
[1]: <http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/Introduction/chapter_1_section_1.html>
_______________________________________________
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