Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Programmer Help > Re: Delay help
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 3789 of 3882
Post > Topic >>

Re: Delay help

by Gregory Weston <uce@[EMAIL PROTECTED] > Jul 1, 2008 at 10:56 AM

In article 
<8b480d16-aafe-4baa-8b32-af0eac0fd1e7@[EMAIL PROTECTED]
>,
 JoeG <joe.garifo@[EMAIL PROTECTED]
> wrote:

> I am writing a program that calculates the various scores needed to
> construct a DnD character. While doing the calculations, I ask the
> user what skills they want trained by popping up a dialog panel. I
> need to pause the rest of the calculations until the user pressed the
> button in the dialog giving his choice. Everything I have tried so far
> results in an infinite loop. Do I need to implement threading here, or
> is there another option? Any suggestions would be greatly appreciated.
> Thanks

This isn't the problem threading was invented to solve; it's really 
almost the opposite. Essentially what you need to do is put the 
calculations on hold while collecting the new input. Just cache whatever 
you've got, display the dialog and let the normal event loop go. Then 
use the dismissal of the dialog as the signal to retrieve your cached 
information and resume the calc.

The specific technique for doing that depends on information about your 
project which you haven't told us. The big question is: are you using 
Carbon or Cocoa?

-- 
"Harry?" Ron's voice was a mere whisper. "Do you smell something ...
burning?"
   - Harry Potter and the Odor of the Phoenix
 




 5 Posts in Topic:
Delay help
JoeG <joe.garifo@[EMAI  2008-06-30 19:51:22 
Re: Delay help
Gregory Weston <uce@[E  2008-07-01 10:56:59 
Re: Delay help
JoeG <joe.garifo@[EMAI  2008-07-02 06:54:48 
Re: Delay help
Gregory Weston <uce@[E  2008-07-02 14:42:42 
Re: Delay help
Simon Slavin <slavins.  2008-07-03 21:20:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 10:28:03 CST 2008.