• 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
Window move unknown to NSApp?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Window move unknown to NSApp?


  • Subject: Window move unknown to NSApp?
  • From: Bob Estes <email@hidden>
  • Date: Tue, 1 Mar 2005 22:54:50 -0500

Hi, all. I haven't posted to this list before. I don't believe this is a FAQ; if so, I apologize.

I had a problem with a button that would just quit responding for no reason I could think of at first. Now I believe I've determined what is happening, but I don't know how to fix it.

Here's the situation. I have a pause/resume (toggled) button programmed to pause and resume an animation. The button resides in a window separate from the window in which the animation is displayed. Throughout the generation and display of the animation I call

[NSApp nextEventMatchingMask:NSLeftMouseUpMask|NSLeftMouseDownMask untilDate:[NSDate dateWithTimeIntervalSinceNow:0.001] inMode:NSDefaultRunLoopMode dequeue:YES]

to capture mouse events and then process them ([NSApp sendEvent:event];). The button works as expected so long as the enclosing window isn't moved between a resume click and a pause click. By trial and error I determined that the problem was that the new position of the window (and button) was not known to NSApp. It evidently thinks the window is still where it used to be, for If I move the window back to where it was when I clicked resume, pause then works. Of course I could just freeze the window in place, but I'd rather not.

So the question is, how do I tell the app programatically that the window has moved or convey what its new frame is whenever it moves while the computer is otherwise tied up with the animation?

Thanks.

Bob Estes
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Window move unknown to NSApp?
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Can I modify an NSEvent?
  • Next by Date: Re: Help: How to show an application again after 5 days?
  • Previous by thread: Can I modify an NSEvent?
  • Next by thread: Re: Window move unknown to NSApp?
  • Index(es):
    • Date
    • Thread