That's exactly what I had done in the first place, but the results weren't too good. I then wrote a much simpler app (one bouncing ball) to test possible solutions and, of course, started with this very approach. For fun, I allow the user to rotate the container and, sure enough, the ball hangs in mid-air while I'm rotating the view. And this, of course, happens regardless of how slow the steps are because the problem is really that the simulation, the drawing, and all the event handling all happen in the same thread (the main thread), so when I'm playing with the slider, the simulation is not running.

NSTimers are scheduled in particular run-loop modes. Tracking of a mouse drag on a control runs in a special mode, NSEventTrackingRunLoopMode. If you schedule your timer to run in that mode, too, it will keep running while tracking is going on.

Excellent! That solves one of my problems already. Thank you, Ken.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to