Hmm - turns out that a tweak is needed. I have applied a tweak that looks right.......
Code: Select all
Enumeration
#Win
#Panel
#Scrl
#Canv
#Temp
EndEnumeration
If OpenWindow(#Win, 0, 0, 700, 650, "ScrollArea scrollbar positions", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ScrollBarGadget(#Temp, 0, 0, 0, 0, 0, 100, 100, #PB_ScrollBar_Vertical)
iScrlBarW = GadgetWidth(#Temp, #PB_Gadget_RequiredSize)
FreeGadget(#Temp)
SetWindowColor(#Win, RGB(240,240,240))
PanelGadget(#Panel, 1, 1, 698, 648)
AddGadgetItem(#Panel, -1, "Tab 0")
ScrollAreaGadget(#Scrl, 5, 40, 376, 570, 1000, 1000, 10, #PB_ScrollArea_BorderLess | #PB_ScrollArea_Center)
CanvasGadget(#Canv, 0, 0, 1000, 1000, #PB_Canvas_Container)
CloseGadgetList() ;#Canv
CloseGadgetList() ;#Scrl
StartDrawing(CanvasOutput(#Canv))
Box(0, 0, GadgetWidth(#Canv), GadgetHeight(#Canv), RGB(192,192,192))
LineXY(500, 0, 500, 1000, RGB(200,000,000))
LineXY( 0, 500, 1000, 500, RGB(200,000,000))
DrawingMode(#PB_2DDrawing_Outlined)
Box(332, 235, 336, 530, RGB(000,000,200))
StopDrawing()
SetGadgetAttribute(#Scrl, #PB_ScrollArea_X, ((1000 - 376) / 2) + (iScrlBarW / 2))
SetGadgetAttribute(#Scrl, #PB_ScrollArea_Y, ((1000 - 570) / 2) + (iScrlBarW / 2))
Repeat
Until WaitWindowEvent(1) = #PB_Event_CloseWindow
EndIf