Adding to index 0 of ListIconGadget with large icons
Posted: Sun Nov 23, 2014 10:43 am
Just stumbled across this problem, and it appears to be a bug?
I need to use large icons with a ListIconGadget, and I need to
add items to the top of its list (index 0). With small icons, it
works. With large icons, the items get added to the end, as
if I'd used position parameter -1 instead of 0.
Check it out. Run this, then click the ListIconGadget to see
that new items are correctly added to the TOP with every
click. Then, uncomment the large icon line, and run again.
They're added to the BOTTOM instead. The manual says
that using 0 as the param adds them to the TOP, but
clearly it doesn't with large icon mode. A bug?
I need to use large icons with a ListIconGadget, and I need to
add items to the top of its list (index 0). With small icons, it
works. With large icons, the items get added to the end, as
if I'd used position parameter -1 instead of 0.
Check it out. Run this, then click the ListIconGadget to see
that new items are correctly added to the TOP with every
click. Then, uncomment the large icon line, and run again.
They're added to the BOTTOM instead. The manual says
that using 0 as the param adds them to the TOP, but
clearly it doesn't with large icon mode. A bug?
Code: Select all
CreateImage(0,32,32,24,#Red)
OpenWindow(0,200,200,200,250,"test",#PB_Window_SystemMenu)
ListIconGadget(0,10,10,180,230,"test",80)
;SetGadgetAttribute(0,#PB_ListIcon_DisplayMode,#PB_ListIcon_LargeIcon)
For a=4 To 1 Step -1
AddGadgetItem(0,0,Str(a),ImageID(0))
Next
Repeat
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget
AddGadgetItem(0,0,Str(Random(999)),ImageID(0))
EndIf
Until ev=#PB_Event_CloseWindow