At 01:20 PM 8/21/2002 +1000, Sean Rogers wrote: >I'm building a program that basically functions like this: you press >a "Play" button with the stylus and a looping animation begins, then >when you select "Pause" the animation stops. > >How can I use the pause button to break the loop? So far once I send >the program into the loop it won't accept anymore events, so it never >gets out of the loop.
Your animation loop shouldn't be looping on its own. Instead, you should set up your animation as a state machine, where it gets pushed to the next state (frame) at set time intervals. Then, make sure your call to EvtGetEvent has a small timeout value, and check the animation timing when you receive nilEvents from the OS. If you just enter a loop and never grab new events and handle them appropriately, you get an unresponsive application, as you've noticed. -- Ben Combee <[EMAIL PROTECTED]> CodeWarrior for Palm OS technical lead Palm OS programming help @ www.palmoswerks.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
