> In reply to a message from "Mike Davis" <[EMAIL PROTECTED]>:
>
> Mike, I see a couple of things that look suspicious in your
> CheckEscape() routine:
>
> 1. You don't check the event.type, you just access the event data
> *assuming* that it's ctlEnterEvent.
There are only two events that are of interest in this loop. The
pressing of the ESC key, which is checked and the open form event
which I am trying to pass on to the form handler.
> 2. If you look at nearly all the example source code out there, they
> call two other OS routines in the event loop besides
> FrmDispatchEvent(): SysHandleEvent() and MenuHandleEvent(). My hunch
> is SysHandleEvent() provides magic that is needed for event processing
> to run as intended, and CheckEscape() is not allowing that magic to
> happen.
That is not the problem. I was trying to simplify this to the least
amount of code, to keep it simple. This is the actual routine and it
does have SysHandleEvent and MenuHandleEvent. I have tried it both
ways without success.
void CheckUserPaused(void) {
EventType event;
UInt16 err;
EvtGetEvent(&event, 0);
if(event.data.ctlEnter.controlID == btnESC) {
progPaused = TRUE;
}
else {
if (!SysHandleEvent(&event) && !MenuHandleEvent(0, &event,
&err))
FrmDispatchEvent(&event);
}
}
}
> > 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);
> > }
> > }
>
>
> --
> Roger Chaplin
> <[EMAIL PROTECTED]>
>
> --
> 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