This is pretty non-responsive to the question. I know how event
processing works. I have event handlers for this form. I have a
normal event processing loop.
But this specific case is what I am looking for a solution; not how
normal processing works. I have shown the code that should be able
to handle the event and open the form but it doesn't. The API
documentation says that FrmDispatchEvent() passes control to the form
handler but it does not seem to work in this case.
Just in case someone else might have the answer, I'll ask the
question again. I have a loop in my application that is executed
during part of my application. Control eventually gets passed back
to the main event processing loop but there is some amount of time
spent in this loop. While in this loop, I call a functions to check
for pending events, so that I can break from the loop and/or process
an event that will open a form (one of the possible things that can
happen while in this loop).
My problem is that I can pause (escape out of this loop) but the form
is never opened. What is wrong with this function that it would not
allow a form to be opened while in this loop.
Here is the loop logic. One of the things that can be done in the do
something section, is a FrmPopupForm(frmMyForm) but frmMyForm is
never opened. I'm sure the problem lies with this Escape Function
that is somehow not allowing events to reach my handler. Can anyone
tell why this should not work? I do have event handlers for the form
and I can open the form with FrmPopupForm(frmMyForm) from outside of
the loop but not if FrmPopupForm is called while in this loop.
//Begin Loop
CheckEscape()
// do something
//Repeat Loop
void CheckEscape(void) {
EventType event;
UInt16 err;
EvtGetEvent(&event, 0);
if(event.data.ctlEnter.controlID == btnESC) {
progPaused = TRUE;
}
else {
FrmDispatchEvent(&event);
}
}
> FrmPopupForm works by putting events on the event queue. I think it
> puts a frmLoadEvent on the queue, and possibly also a winExitEvent and
> winEnterEvent. These events, when processed normally, cause the form
> to get loaded and then get a frmOpenEvent, etc. Since the event loop
> is part of each Palm application, it is up to you to follow the rules
> if you want this kind of thing to work normally. Look in the tutorial
> to see how this is done. The event handlers for each form are normally
> set as part of the handling of the frmLoadEvent. If your event loop
> calls FrmDispatchEvent, it'll pass the event to the current form's
> event handler. Start with the same event handling used in the
> tutorial, and change it only if you need to implement some unusual
> functionality such as timed animation. For most Palm applications
> other than games, the basic event handling is pretty much the same, so
> you can just cut and paste the necessary code from the tutorial or one
> of the example applications such as Memo Pad.
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palm.com/devzone/mailinglists.html
>
--
-----------------------------------------------------------------
Discussion Group: http://www.halcyon.com/ipscone/wwwboard/
Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html