Start with a timout value of 0, which you pass to EvtGetEvent instead of evtWaitForever. This causes the function to return nilEvent instead of waiting for some other event to occur. When you recieve the next event (any event, including nilEvent), get the current time and store it somewhere, and write it out to your form. Next time through, if it's changed from whatever it was last time, update your form, store the new value, and you're good to go. No big deal.
At this point (when the time changes), you might want to change your timeout value to whatever is returned by SysTicksPerSecond() - thus causing your event handling routine to be called whenever an event needs handling, or when one second has passed - whichever comes first. This minimizes the processing you're doing, and in theory, might have a positive effect on battery life. I don't know what, if any, of this works or doesn't work with PalmOS 2.0. You'll have to do some research, I suppose. No sample code either, I'm afraid. You're on your own there. I don't know how many ticks your code might take to execute -- I could see the possibility of wanting to subract that number from what you're using. There might be a wealth of other issues I never thought of. In any event, it ought to get you started in the right direction. See the PalmOS Programmer's API Reference for the specifics. Brandon On Wed, 2 Mar 2005 02:30:17 -0000, Terry Young <[EMAIL PROTECTED]> wrote: > I want to display the time on a form. I have several questions: > 1 - What event (or interrupt) do I look for to update the time > in the event loop. > 2 - Is there a way to set the interval of the event. > 3 - This has to be backward compatable to PalmOS 2.0 > 4 - Does anyone have any sample code I could look at. > > Thanks in advance. > > Terry > > -- > 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/
