Restored from previous forum. Originally posted by Joël Roly.
Hi All
I does not understand by why TrackBar does not advance
It advances when I move the mouse on the form.
If you have a solution, thank you in advance.
Joël
------------------------------------------------------------
#WindowWidth = 300
#WindowHeight = 200
pt.w=0
ptx.w=0
If OpenWindow(0, 100, 120, #WindowWidth, #WindowHeight, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "TrackBarGadget")
If CreateGadgetList(WindowID())
TrackBarGadget(1,10,10,170,25,0,100)
Repeat
SetGadgetState(1,ptx)
Delay(10)
If ptx<100
pt=pt+1
If pt=10
pt=0
ptx=ptx+1
EndIf
EndIf
EventID.l = WaitWindowEvent()
;--------------------------------
If EventID = #PB_EventGadget
EndIf
;--------------------------------------
If EventID = #PB_EventCloseWindow ; Si on presse le bouton end
Quit = 1
EndIf
Until Quit = 1
EndIf
EndIf
End
Probleme TrackBarGadget
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> I does not understand by why TrackBar does not advance
> It advances when I move the mouse on the form.
It's because you're using WaitWindowEvent -- this means your app
will wait for an event (such as a mouse movement) before continuing.
So when you move your mouse, the event occurs, and the TrackBar can
advance. You can try using WindowEvent instead of WaitWindowEvent
to make the TrackBar advance without waiting.
> I does not understand by why TrackBar does not advance
> It advances when I move the mouse on the form.
It's because you're using WaitWindowEvent -- this means your app
will wait for an event (such as a mouse movement) before continuing.
So when you move your mouse, the event occurs, and the TrackBar can
advance. You can try using WindowEvent instead of WaitWindowEvent
to make the TrackBar advance without waiting.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm