At 1:15 PM -0700 1999/04/19, Paul Dugas wrote:
>Hum... For some reason, I'm getting a nilevent delivered to one of my forms
>event handlers. I'm doing a bit of timing based on a global storing the
>time of the next event and passing a timeout to the EvtGetEvent() call.
>Turns out that if I turn off my timing stuff (by always passing
>evtWaitForever), I'm still getting a nil event to this form. It appears to
>happen when I press a PushButton. Is this supposed to happen? Why is it
>delivering the nilevent?
This issue has been covered previously in this forum. The short answer is your code
should NOT rely on the EvtGetEvent timeout as the ONLY source of nilEvents. The Palm
OS generates them at various other times, as does POSE, and our OS documentation is
being updated to reflect this [correct] behavior. Nil events are to be considered
benign events, helping the OS to SysHandleEvent some internal action.
If you need specific timing information in and around your main event loop, use
TimGetTicks to compute an appropriate timeout (if necessary) and/or structure your
code so that it does not depend on any particular event type for timing calculations.
Regards,
Jim Schram
3Com/Palm Computing
Partner Engineering