Page 1 of 1

TrackBarGadget

Posted: Sun Oct 19, 2003 8:25 am
by Stephen
Im a little lost with Trackbargadget,
i understand it and can alter it.
But i just cant get the results to change the volume,
Please help

Posted: Sun Oct 19, 2003 8:46 am
by CS2001
You can get the Result with getgadgetstate(gadgetid):

Code: Select all

; PureBasic Visual Designer v3.80 build 1249


;- Window Constants
;
Enumeration
  #Window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Gadget_0
EndEnumeration


Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 600, 300,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
    If CreateGadgetList(WindowID())
      TrackBarGadget(#Gadget_0, 0, 80, 600, 30, 0, 100, #PB_TrackBar_Ticks)
      
    EndIf
  EndIf
EndProcedure
Open_Window_0()

Repeat
  
  Event = WaitWindowEvent()
  
  If Event = #PB_EventGadget
    GadgetID = EventGadgetID()
    If GadgetID = #Gadget_0
      Debug GetGadgetState(#Gadget_0)
    EndIf
  EndIf
  
Until Event = #PB_EventCloseWindow

End
CS2001