• 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
How to know if an NSView has pending draws
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to know if an NSView has pending draws


  • Subject: How to know if an NSView has pending draws
  • From: Jeff Evans <email@hidden>
  • Date: Thu, 04 Feb 2016 15:07:30 -0800

Suppose one wants to do a task in an NSView only once it has no drawRect calls pending. Is there any way to tell, for a particular NSView, if there are any drawing events coming up? Whether, that is, the view is up to date?

I've tried counting my explicit uses of setNeedsDisplay and decrementing that count at drawRect, but the trouble is that one can call setNeedsDisplay many times and that will not translate into the same number of drawRects.

One idea was to call getRectsBeingDrawn at drawRect and hope that the number of rects is equal to the number of update requests combined into that call. But the number of rects does not appear to equal the number of draw requests.

But there must be some place that contains a queue of upcoming draw requests. If so, is there access to it?

I'm hoping this is a dumb question.

Thanks, Jeff



_______________________________________________

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: How to know if an NSView has pending draws
      • From: "Clark S. Cox III" <email@hidden>
  • Prev by Date: Re: auto-layout and rotated UILabels
  • Next by Date: Re: How to know if an NSView has pending draws
  • Previous by thread: Re: auto-layout and rotated UILabels
  • Next by thread: Re: How to know if an NSView has pending draws
  • Index(es):
    • Date
    • Thread