Frank LaRosa wrote:

Logan,

Thanks for the reply. It sounds a bit more complicated than I'd hoped.
Let me explain exactly what I'm trying to accomplish.

My application is a board game where the user makes a move, then waits
for the program to compute a counter-move. If the user sets the skill
level very high, the counter-move calculation could take a long time,
perhaps 45 seconds to a minute.

During the calculation, it's not valid for the user to do anything else
with the application itself, like select another function or open a
menu. So I don't care about throwing away application events.

However, I want to allow things like system alerts to show; if the user
presses the Find button, I want that to interrupt the calculation; if
the phone rings, I want them to be able to answer it; and if the user
decides to give up and exit (by selecting another application or
pressing the Home key) then I want to abort and let my application
exit.

I have part of that working now by doing this:

EventType event;
EvtGetEvent(&event, 0);
        
while ((event.eType != nilEvent) && (event.eType != appStopEvent)) {
        SysHandleEvent(&event);
        EvtGetEvent(&event, 0);
}
                
return (event.eType == appStopEvent);

The function in which this occurs returns "true" to force the game
algorithm to end early. Doing this does cause the Find dialog to pop-up
while the app is otherwise in its busy loop. However, pressing the Home
button does not generate the appStopEvent that I was expecting. It does
generate a few pen up/down events, but that's about it.


Sounds like you need to let it go to FrmDispatchEvent (). You could just ignore every event in your event handler as long as you in the calculation loop.


Regards
Henk
--
-------------------------------------------------------------------------
  Henk Jonas                                            [EMAIL PROTECTED]
  Palm OS � certified developer

  Please contact me, if you need an off-side contract worker.
-------------------------------------------------------------------------

--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to