AddGadgetItem()

Syntax

AddGadgetItem(#Gadget, Position, Text$ [, ImageID [, Flags]])
Description
Add a new item to the specified gadget.

Parameters

#Gadget The gadget to use.
Position The item index where the new item should be inserted. To add the item at the start, use an index of 0. To add this item to the end of the current item list, use a value of -1. Remember that when you add an item that all current items which come after the new one will have their positions increased by 1.

#PB_Any can be used, in which case the return-value will be the new number assigned by PB.
Text$ The text for the new item.

When adding an item to a ListIconGadget(), this parameter can contain the text for multiple columns separated by a Chr(10) character.
ImageID (optional) An optional image to use for the item in gadgets that support it. The used image should be in the standard 16x16 size. Use the ImageID() command to get the ID for this parameter.
Flags (optional) This parameter has a meaning only for the following gadget types:

TreeGadget()
This parameter specifies the new sublevel for the item. If the sublevel is greater than that of the previous item, the new one will become this item's child. If it is lower, it will be added after the parent of the previous item.

Return value

None.

Remarks

The following gadgets are supported:

- ListIconGadget() : supports the ImageID.
- ListViewGadget()
- PanelGadget() : supports the ImageID.
- TreeGadget() : supports the ImageID. 'Flags' is required and specifies the new sublevel.

See Also

RemoveGadgetItem(), ClearGadgetItems(), CountGadgetItems(), ComboBoxGadget(), ListIconGadget(), ListViewGadget(), PanelGadget(), TreeGadget()
<- AddGadgetColumn() - Gadget Index - BindGadgetEvent() ->