I'm messing about with a TrackBarGadget and there only seems to be one way to get events from it, which I've hacked up below. Basically you get an event from the gadget and use GetGadgetState(). Anything better than what I've got?
Code: Select all
EnableExplicit
Define.l event
Define.l quit : quit = 0
If OpenWindow(0, 0, 0, 800, 600, "foo", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
TrackBarGadget(0, 10, 10, 400, 20, 0, 100)
While Not(quit)
event = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
quit = 1
Case #PB_Event_Gadget
If EventGadget() = 0
Debug GetGadgetState(0)
EndIf
EndSelect
Wend
CloseWindow(0)
EndIf
End
Is it possible to get events whether the thumb has been pressed or released in a cross platform way? I've searched the forums and every suggestion has been Windows only. I really need the cross platform aspect, so while API solutions would be OK they'd have to be for each platform (and I don't have a Mac or enough Linux knowledge) so I'd prefer a PB method.
I think I know what the answer will be, so any chance of getting these events added (mods feel free to move this to feature requests in that case ;)
Cheers.

