Page 1 sur 1
SetTimer_ sous PB4 ?
Publié : ven. 09/juin/2006 20:00
par wolfjeremy
Salut,
Dans la version 3 de PB j'utilisais SetTimer_ comme ceci :
Ce pendant sa ne marche plus sur la version 4 de PB, quel sont les modification a faire ? car le debugger ne m'indique rien...
Merci d'avance pour votre aide.
Publié : ven. 09/juin/2006 20:18
par Gillou
c pareil qu'avant?
Procedure test()
SetGadgetText (0, FormatDate ( "%hh : %ii : %ss" , Date ()))
EndProcedure
win = OpenWindow ( #PB_Any , 0, 0, 200, 200, "test" , 13238273)
If win And CreateGadgetList ( WindowID (win))
TextGadget (0, 10, 10, 180, 20, "" )
SetTimer_ ( WindowID (win), 0, 1000, @test())
Repeat
Select WaitWindowEvent ()
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
KillTimer_ ( WindowID (win), 0)
Publié : ven. 09/juin/2006 21:18
par wolfjeremy
Non pas vraiment moi j'utilisais sa en version 3 :
Procedure TimerProc(hwnd.l, uMsg.l, idEvent.l, dwTime.l)
Select uMsg
Case #WM_TIMER
Select idEvent
Case 1
EndSelect
EndSelect
EndProcedure
Publié : ven. 09/juin/2006 21:21
par Gillou
Tu peux faire comme ça aussi
Procedure test()
SetGadgetText (0, FormatDate ( "%hh : %ii : %ss" , Date ()))
EndProcedure
win = OpenWindow ( #PB_Any , 0, 0, 200, 200, "test" , 13238273)
If win And CreateGadgetList ( WindowID (win))
TextGadget (0, 10, 10, 180, 20, "" )
SetTimer_ ( WindowID (win), 0, 1000, @test())
Repeat
Select WaitWindowEvent ()
Case #WM_TIMER
Debug "test"
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
KillTimer_ ( WindowID (win), 0)
Publié : ven. 09/juin/2006 21:44
par wolfjeremy
Ok merci.