>1) Is using the nilEvent [via 'EvtGetEvent(&event, sysTicksPerSecond);'] the
>best way to get a clock to update every second?
Yes.
>2) How do I catch the menu opening and closing so that I know not to draw my
>clock while that's displayed.
There's an article in the knowledge base that discusses that. You
might want to try a search on "menus" or "winEnterEvent" or something
like that. Basically, in your form's event handler, you add cases
like the following, and only only draw when gStopDrawing == false:
case winExitEvent:
if ( eventP->data.winExit.exitWindow == ( WinHandle )
FrmGetFormPtr ( FormName ))
{
gStopDrawing = true;
}
break;
case winEnterEvent:
if ( eventP->data.winEnter.enterWindow == ( WinHandle )
FrmGetFormPtr ( FormName ) &&
eventP-> data.winEnter.enterWindow == ( WinHandle ) FrmGetFirstForm ())
{
gStopDrawing = false;
}
break;
Note: gStopDrawing is a global, which may not always be appropriate.
Regards,
Steve Mann
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/