newbie--event help

BlitzPlus Forums/BlitzPlus Programming/newbie--event help

gellyware(Posted 2003) [#1]
Hi, Im trying to have a countdown timer, counting from one hour to zero seconds. The problem is, when i go to the file menu of my app, the timer stops. Is there a way to allow the timer to continue if a user is going through the menu system? Here is my code:

id = WaitEvent (0)

Select id


Case $1001 ;menu event
Select EventData()
Case menuNew:
checkTimer()
setTimer()
Case menuExit:
checkTimer()
quit()
Case menuTimerOn
CheckMenu (timerOn)
UncheckMenu (timerOff)
UpdateWindowMenu mainWindow
showTime = True
Case menuTimerOff
UncheckMenu (timerOn)
CheckMenu (timerOff)
UpdateWindowMenu mainWindow
showTime = False
Default:
checkTimer()
Return
End Select

Case $803 ; close window
quit()
Default

checkTimer()

End Select


soja(Posted 2003) [#2]
Well, the way BlitzPlus works is that it stops processing events when you perform a modal action, such as accessing the menu, moving/resizing the window, or moving a slider. It is kind of annoying unless you figure out a good way to deal with it.

What you might do is catch the event $2004 (Modal Begin), take a snapshot of Millisecs(), and then catch event $2005 (Modal End), figure out the difference, and continue from there. I'm not sure if there's a better way to deal with it.