Secondary run loops?
Secondary run loops?
- Subject: Secondary run loops?
- From: Mark Dawson <email@hidden>
- Date: Wed, 09 Aug 2006 20:28:14 -0700
I'm not as famailiar with run loops in Cocoa and how they work. Here's my problem:
If I have a "start" button and the user presses it, my action gets called. If I do "stuff" within that call (posting notifications, etc), it's still happens relative to that call, so the UI isn't being updated.
What I would have done in (old, not sure about new) Carbon would be (pseudo code):
while !done
do_something(); // the actual work; could be a thread
while WaitNextEvent() && !quit() && !processDone()
updateProgressBar(); // UI is active, stop if user has pressed "stop" button or thread has finished
This would have been called from the "start" event message (i.e., nested WaitNextEvents).
What's the best way to do this in Cocoa? What I'm really not sure is how to let events happen while I'm in my loop?
Thanks!
mark
_______________________________________________
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