On Fri, Jun 27, 2008 at 10:55 PM, Daniel Richman <[EMAIL PROTECTED]> wrote: > What's happening is that if I enter a number and then press 'start', 'start' > stays in the 'pressed' position until the loop finishes, after which it > returns to the normal position. My guess is that this is stopping any other > UI events from occurring. This would also explain why I'm able to log a > message each time the loop iterates. > > But I'm still not sure why the button is staying pressed. Thoughts, anyone?
If you're not running the event loop then the button has no chance to repaint. You absolutely cannot block the main thread like this and expect the GUI to still function. Any reason you're not using NSTimer? Along with the painting issues, this strategy also won't work 100% of the time because sleep() is only guaranteed to block for *at most* a certain number of seconds. It can exit early if it chooses to, in particular it will if you don't mask signals from being delivered on your thread, _______________________________________________ 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]