ScrollBarGadget not working
Code: Select all
;{ Gadgets
Enumeration
#Button_0
#TrackBar_1
#ScrollBar_2
#ButtonImage_3
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 610, 142, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
ButtonGadget(#Button_0, 65, 30, 105, 30, "Gadget_0")
TrackBarGadget(#TrackBar_1, 30, 150, 310, 40, 0, 100, #PB_TrackBar_Ticks)
ScrollBarGadget(#ScrollBar_2, 30, 215, 295, 25, 0, 100, 25)
ButtonImageGadget(#ButtonImage_3, 65, 75, 100, 25, 0)
EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #Button_0
ElseIf EventGadget = #TrackBar_1
ElseIf EventGadget = #ScrollBar_2
EndIf
Case #WM_LBUTTONUP
Select GetActiveGadget()
Case #Button_0
Debug "Button_0"
Case #TrackBar_1
Debug "TrackBar_1"
Case #ScrollBar_2
Debug "ScrollBar_2"
Case #ButtonImage_3
Debug "ButtonImage_3"
EndSelect
; ////////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
;
;}