Code: Select all
If OpenWindow(0, 0, 0, 355, 180, "TreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TreeGadget(0, 10, 10, 160, 160) ; TreeGadget standard
For a = 0 To 10
AddGadgetItem(0, -1, "Normal Item "+Str(a), 0, 0) ; if you want to add an image, use
Next
For a = 0 To 10
AddGadgetItem(0, 3, "Sub Item "+Str(a), 0, 1) ; if you want to add an image, use
Next
EndIf
Procedure debugevent()
Debug GetGadgetState(0)
EndProcedure
BindEvent(#PB_Event_Gadget,@debugevent())
CompilerIf #PB_Compiler_OS <> #PB_OS_Web
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
CompilerEndIf
BR
Erlend