to fill it with 1.000 and more ImageGadgets like this:
but..
Code: Select all
Anz = 999
w = 190 : h = 160
x = Int(800/(w+2))
If Anz % 4
y = (Anz / x) + 1
Else
y = (Anz / x)
EndIf
OpenWindow(0, 0, 0, 800, 600, "", #WS_OVERLAPPEDWINDOW )
ScrollAreaGadget(0, 0, 0, 800, 600, 800, 600)
Debug "Needed Height:" + str(y * (h+2))
SetGadgetAttribute(0, #PB_ScrollArea_InnerHeight, y * (h+2))
; Seems that ScrollAreaHeight is limited to half WORD ($FFFF/2)
Debug "Have got: " + str(GetGadgetAttribute(0, #PB_ScrollArea_InnerHeight))
posy = 2
For i = 1 To y
posx = 2
For n = 1 To x
Count + 1
CreateImage(Count, w, h)
If StartDrawing(ImageOutput(Count))
Box(0,0,w,h, #White)
DrawText(10,10, Str(Count), #Blue, #White)
StopDrawing()
EndIf
ButtonImageGadget(#PB_Any, posx, posy, w, h, ImageID(Count))
posx + w + 2
Next
posy + h + 2
Next
CloseGadgetList()
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow