• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UI elements in custom view mess up drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: UI elements in custom view mess up drawing
      • From: Antonio Nunes <email@hidden>
References: 
 >UI elements in custom view mess up drawing (From: Antonio Nunes <email@hidden>)

  • Prev by Date: UI elements in custom view mess up drawing
  • Next by Date: Re: UI elements in custom view mess up drawing
  • Previous by thread: UI elements in custom view mess up drawing
  • Next by thread: Re: UI elements in custom view mess up drawing
  • Index(es):
    • Date
    • Thread