[Solved]ScrollArea scrollbar height
Posted: Tue Nov 26, 2024 2:08 pm
Hello everyone, I have a small problem, I have a main window with two scrollArea gadgets, at program startup they are filled with more gadgets(variable number of gadgets), so far so good, I created a procedure to increase the vertical scroll area, but it works only the next time, pressing refresh on the button I created on the interface, the procedure that is called both for the refresh button and at program startup after the panes are filled is as follows, surely I am doing some nonsense wrong:
Code: Select all
Procedure Mia_RidimensionaScroll(fake = 0)
Protected NumeroBloccati, NumeroSbloccati, DimensioneDestra, DimensioneSinistra
ForEach ListaGiochi()
If ListaGiochi()\Bloccato
NumeroBloccati + 1
Else
NumeroSbloccati + 1
EndIf
Next
If NumeroBloccati > 12
DimensioneDestra = 429 + (((NumeroBloccati - 12) + 2) / 3) * 90
SetGadgetAttribute(#ScrlArea_unLock, #PB_ScrollArea_InnerHeight, DimensioneDestra)
Else
SetGadgetAttribute(#ScrlArea_unLock, #PB_ScrollArea_InnerHeight, 429)
EndIf
If NumeroSbloccati > 12
DimensioneSinistra = 429 + (((NumeroSBloccati - 12) + 2) / 3) * 90
SetGadgetAttribute(#ScrlArea_Lock, #PB_ScrollArea_InnerHeight, DimensioneSinistra)
Else
SetGadgetAttribute(#ScrlArea_Lock, #PB_ScrollArea_InnerHeight, 429)
EndIf
EndProcedure