Luc Le Blanc wrote:

> I'm trying to setup a stopwatch-like dialog where I have a
> Start/Stop button, and an OK button. When the Start button is hit,
> I start displaying elapsed time until the Stop button is hit or
> the Datebook hardware button is depressed. My problem is handling
> the OK button (to leave the dialog even while the timer is running)
> and events like a vchrLaunch keyDownEvent (to leave the
> application). None of my many attempts fully succeeded. Either
> the vchrLaunch is ignored, or the OK button, or both.
> My latest attempts goes like this. What's wrong?


For the sake of archives, let's complete this thread. With the generous help of 
Aaron Ardiri, I understood the FrmDoDialog API waits forever for events, thus 
never throwing nilEvents. One can implement a custom version of FrmDoDialog to 
circumnvent that, or, like I finally did, simply call EvtSetNullEventTick( 
TimGetTicks() + SysTicksPerSecond() / 10 ) when the Start button is hit, so as 
to fire a first nilEvent, and repeat that same code when handling a nilEvent, 
to insure another nilEvent is received 0.1 s later, and so on.


-- 
Luc Le Blanc
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to