I added the track bar gadget to my program, and noticed that it doesn't appear to send #pb_eventType_change, so I'm curious what's the best way to go about checking for changes?
I could always store the previous result of GetGadgetStatus and compare it in the loop, but there must be a better way?
Code: Select all
EnableExplicit
OpenWindow(0, #PB_IGNORE, #PB_IGNORE, #PB_IGNORE, #PB_IGNORE, "test", #PB_Window_ScreenCentered|#PB_Window_Maximize)
TrackBarGadget(0, 0, 0, WindowWidth(0), WindowHeight(0), 0, 100, #PB_TrackBar_Vertical)
;SpinGadget(0, 0, 0, WindowWidth(0), WindowHeight(0), 0, 100, #PB_Spin_Numeric)
Repeat
Define e=WaitWindowEvent()
If e=#PB_Event_Gadget And EventType()=#PB_EventType_Change
SetWindowTitle(0, ""+GetGadgetState(0))
EndIf
Until e=#PB_Event_CloseWindow