Re: How to make NSWindow redraw vacated rects "ifNeeded"?
Re: How to make NSWindow redraw vacated rects "ifNeeded"?
- Subject: Re: How to make NSWindow redraw vacated rects "ifNeeded"?
- From: Jerry Krinock <email@hidden>
- Date: Mon, 9 Apr 2007 09:40:45 -0700
On 2007 Apr, 08, at 20:12, Adam R. Maxwell wrote:
If you use setNeedsDisplay: it can be displayed on the next pass
through the runloop, so you can send multiple setNeedsDisplay:
messages without actually drawing anything.
That's true; I was simply pointing out the equivalence of -display
vs. -displayIfNeeded in the degenerate case.
You can make it more efficient, certainly, using NSUnionRect, -
[NSView opaqueAncestor] and other means; I have no idea how your
view hierarchy is set up.
Apple has thought about this and optimized it. Have you read
<http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaViewsGuide/Optimizing/chapter_7_section_4.html>? It describes
this quite well, and says that using -display should generally be
avoided.
Yes, I see. My actual application is to update a progress window
during a long task with multiple branches. At some times, depending
on the latest result, the user is given the option to check a
checkbox, select from a pulldown menu, etc., and then click a button
i.e. "Cancel", "No", "Yes". I do this all in the main thread because
the app cannot logically continue until the task is complete.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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