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()
- EditorGadget()
- ListIconGadget()
- ListViewGadget()
- MDIGadget()
- PanelGadget()
- TreeGadget()

Example

  If OpenWindow(0, 0, 0, 220, 150, "ClearGadgetItems", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ListViewGadget(0,10,10,200,100)
    For a = 1 To 10 : AddGadgetItem (0, -1, "Item "+Str(a)) : Next    ; add 10 items
    ButtonGadget(1, 10, 120, 150, 20, "Clear Listview contents")
    Repeat
      Event = WaitWindowEvent()
      If Event = #PB_Event_Gadget
        If EventGadget() = 1
          ClearGadgetItems(0)
        EndIf
      EndIf
    Until Event = #PB_Event_CloseWindow
  EndIf

See Also

AddGadgetItem(), RemoveGadgetItem(), CountGadgetItems()

Supported OS

All

<- ClearGadgetItemList() - Gadget Index - CloseGadgetList() ->