• 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: extra redrawing with [self setBounds:] in drawRect:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extra redrawing with [self setBounds:] in drawRect:


  • Subject: Re: extra redrawing with [self setBounds:] in drawRect:
  • From: Jim Correia <email@hidden>
  • Date: Mon, 28 Jan 2008 21:32:42 -0500

On Jan 28, 2008, at 8:43 PM, Nathan Vander Wilt wrote:

extra redrawing with [self setBounds:] in drawRect:


In my custom view, I set the bounds in my drawRect: method before drawing. This is so that while the user is resizing the window, the content stretches with the view.

[...]

Somehow this selection rectangle code triggers random
extra redrawing.

It is unclear why you need to resize your view inside of -drawRect:. This is surely the root cause of your problem.


If your view cannot be automatically resized when the window is resized via springs and struts, use the appropriate mechanism to adjust the view's frame.

Resizing the view inside of -drawRect: doesn't sound like good design. And it isn't terribly surprising that it might confuse the code which tracks view invalidation.

Jim

_______________________________________________

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


References: 
 >extra redrawing with [self setBounds:] in drawRect: (From: Nathan Vander Wilt <email@hidden>)

  • Prev by Date: Receiving mouseMoved events with no NSView?
  • Next by Date: Re: extra redrawing with [self setBounds:] in drawRect:
  • Previous by thread: extra redrawing with [self setBounds:] in drawRect:
  • Next by thread: Re: extra redrawing with [self setBounds:] in drawRect:
  • Index(es):
    • Date
    • Thread