Code: Alles auswählen
Declare TimerCallBack(hWnd.l,Msg.l,wParam.l,lParam.l)
Font12b.l = LoadFont(#PB_Any, "Arial", 12, #PB_Font_Bold)
#window = 0
#text = 0
OpenWindow(#window, 0, 0, 200, 100, "es flackert", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
TextGadget(#text, 30, 40, 110, 20, "")
SetGadgetFont(#text, FontID(Font12b))
SetTimer_(WindowID(#window), 77, 500, @TimerCallBack()) ;Wiederholzeit=500 ms; Identifier=77
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
Procedure TimerCallBack(hWnd.l,Msg.l,wParam.l,lParam.l)
Static i
i = i + 1
Select Msg
Case #WM_TIMER
If wparam = 77
SetGadgetText(#text, Str(i) + ". Durchlauf")
EndIf
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure