Is it possible that the TrackbarGadget is no friend with the CanvasGadget?
I do have a code here where I have both of them and not matter, where I place them, the TrackBarGadget overlaps the Canvas.
Once I remove the trackbar (commenting line 23), the Canvas is visible again.
Do I miss something? Thank you!
Edit:
There seems to be something wrong. I changed the TrackbarGadget to other GadgetTypes and have similar issues (with invisible objects).
Code: Select all
Enumeration
#mainWin ; Window
#metroCanvas ; Canvas / Drawing area
EndEnumeration
Enumeration
#btnStartStop ; ToggleButton
#trkBeats ; Trackbar
EndEnumeration
#TOGGLED_ON = 1 ; toggle states
#TOGGLED_OFF = 0
#AppTitle = "Demo Trackbar & Canvas"
Declare OnBtnStartStopClick()
Declare GadgetEvents()
; Open The Window and Create Gadgets
OpenWindow(#mainWin, 5, 5, 400, 500, #AppTitle, #PB_Window_SystemMenu)
CanvasGadget(#metroCanvas, 5, 5, 390, 390, #PB_Canvas_Border)
ButtonGadget(#btnStartStop, 5, 400, 64, 32, "Off", #PB_Button_Toggle)
TrackBarGadget(#trkBeats, 5, 450, 390, 5, 1, 4)
; Bind events
BindEvent(#PB_Event_Gadget, @GadgetEvents())
; ===========
Procedure OnBtnStartStopClick()
Debug "Click"
Select GetGadgetState(#btnStartStop) ; 1 = toggled, 0 = normal
Case #TOGGLED_ON
SetGadgetText(#btnStartStop, "On")
; Event
Case #TOGGLED_OFF
SetGadgetText(#btnStartStop, "Off")
; Event
EndSelect
EndProcedure
Procedure GadgetEvents()
Select EventGadget()
Case #btnStartStop
OnBtnStartStopClick()
EndSelect
EndProcedure