ListViewScreenGadget()

Syntax

Result = ListViewScreenGadget(#ScreenGadget, x, y, Width, Height)
Description
Creates a ListView gadget in the current GadgetList. Once a ListView is created, its list of items is empty.

Parameters

#ScreenGadget A number to identify the new gadget. #PB_Any can be used to auto-generate this number.
x, y, Width, Height The position and dimensions of the new gadget.

Return value

Nonzero on success, zero otherwise. If #PB_Any was used as the #ScreenGadget parameter then the return-value is the auto-generated gadget number on success.

Remarks

To add a 'mini help' to this gadget, use ScreenGadgetToolTip().

The following functions can be used to act on the list content:

- AddScreenGadgetItem(): Add an item.
- RemoveScreenGadgetItem(): Remove an item.
- ClearScreenGadgetItems(): Remove all the items
- CountScreenGadgetItems(): Returns the number of items currently in the #ScreenGadget.

- GetScreenGadgetState(): Get the index of the selected item or -1 if there is no selected item.
- GetScreenGadgetText(): Get the content of the selected item.
- SetScreenGadgetState(): Change the selected item. If -1 is specified, the selection will be removed.
- SetScreenGadgetText(): Selects the item with the given text (the text must match exactly).

Supported OS

All

<- IsScreenGadget() - ScreenGadget Index - OpenScreenGadgetList() ->