ClearGadgetItems()

Syntax

ClearGadgetItems(#Gadget)
Description
Clears all the items from the specified gadget.

Parameters

#Gadget The gadget to clear.

Return value

None.

Remarks

The Gadget must be one of the following types:

- ComboBoxGadget()
- ListIconGadget()
- ListViewGadget()
- PanelGadget()
- TreeGadget()

Example

  Procedure ClearEvent()
    ClearGadgetItems(0) 
  EndProcedure
  
  If OpenWindow(0, 0, 0, 220, 150, "ClearGadgetItems", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ListViewGadget(0,10,10,200,100)
    
    ; add 10 items
    For a = 1 To 10 : AddGadgetItem (0, -1, "Item " + a) : Next  
    
    ButtonGadget(1, 10, 120, 150, 20, "Clear Listview contents")
    BindGadgetEvent(1, @ClearEvent())
  EndIf

See Also

AddGadgetItem(), RemoveGadgetItem(), CountGadgetItems()
<- CheckBoxGadget() - Gadget Index - CloseGadgetList() ->