Neither the third item is selected (which I expected because of SetGadgetState(1,2)) nor do the cursor up/down keys show any effect.
But when I click an item inside the ListIconGadget, I can move up and down in the list with the cursor keys.
Here's the code:
Code: Select all
Procedure CloseWindowEvent()
CloseWindow(EventWindow())
EndProcedure
OpenWindow(0, 0, 0, 300, 150, "ListIconGadget", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
ListIconGadget(1, 50, 20, 200, 120, "Comumn", 120)
BindEvent(#PB_Event_CloseWindow, @CloseWindowEvent())
For i = 0 To 10
AddGadgetItem(1, -1, "line #" + Str(i))
Next i
SetActiveGadget(1)
SetGadgetState(1, 2) ;select third item
CompilerIf #PB_Compiler_OS <> #PB_OS_Web
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
CompilerEndIf