• 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: How to make NSWindow redraw vacated rects "ifNeeded"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make NSWindow redraw vacated rects "ifNeeded"?


  • Subject: Re: How to make NSWindow redraw vacated rects "ifNeeded"?
  • From: Andrew Farmer <email@hidden>
  • Date: Sun, 8 Apr 2007 13:23:05 -0700

On 08 Apr 07, at 08:36, Jerry Krinock wrote:
I often find myself needing to sprinkle in what I feel are extra - display messages to NSWindows to when I want them to update. Yesterday I isolated a demo which gets me closer to understanding this.
<...>
   // Update the window
   [window displayIfNeeded] ; // Not good enough!!
   // Uncomment the next line and it works as desired
   // [window display] ;

   // Show for 3 seconds
   [NSThread sleepUntilDate:
      [NSDate dateWithTimeIntervalSinceNow:3.0]];

AppKit depends on the presence of an event loop for a lot of things, including redrawing views. I'm not exactly sure what you're trying to accomplish here, but it'll probably work better if you avoid sleeping outside the event loop. Use NSTimer and -[NSObject performSelector:withObject:afterDelay:] to implement delayed events.


As a general point, BTW, you should never need to call setNeedsDisplay, display, or displayIfNeeded on view objects. (Only exception is a view calling setNeedsDisplay on itself.) The view should otherwise be able to do redraw management for itself.
_______________________________________________


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


  • Follow-Ups:
    • Re: How to make NSWindow redraw vacated rects "ifNeeded"?
      • From: Jerry Krinock <email@hidden>
References: 
 >How to make NSWindow redraw vacated rects "ifNeeded"? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Current Hour & Minutes
  • Next by Date: Re: Handle data disappearing out from underneath me
  • Previous by thread: How to make NSWindow redraw vacated rects "ifNeeded"?
  • Next by thread: Re: How to make NSWindow redraw vacated rects "ifNeeded"?
  • Index(es):
    • Date
    • Thread