Code updated for 5.20+ (same as AddWindowTimer())
As i needed it, here is a simple timer for PB Windows version.
Code: Select all
;
; a simple timer example
;
If OpenWindow(0, 400, 200, 200, 100, "Simple timer example", #PB_Window_SystemMenu)
SetTimer_(WindowID(0), 0, 2000, 0) ; 2000= 2 seconds
Repeat
EventID = WaitWindowEvent()
If EventID = #WM_TIMER
If StartDrawing(WindowOutput(0))
DrawText(20, 20,"Timer finished.", #Black, #White)
StopDrawing()
EndIf
EndIf
Until EventID = #PB_Event_CloseWindow
EndIf
End
Mr Skunk
Edited by - mr.skunk on 27 June 2001 10:55:52