Henk,
Thanks for the advice. It almost works -- for some reason when I press,
say, the calculator button, I end up getting the pen up and pen down
events, a key event, but I never get the appStopEvent, even if I put
exactly the same code in my "busy" loop as I have in my main event
loop.
What I decided to do instead was just put up a "Cancel" button. The
user can hit Cancel to stop the processing and then he can exit the app
the usual way. This seems satisfactory.
It is odd that I never got that appStopEvent, though.
--- Henk Jonas <[EMAIL PROTECTED]> wrote:
> 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/
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/