Blitz3D+ Command Reference

AddGadgetItem gadget,item$[,select][,icon]

Parameters

gadget - combo box, list box or tabber to add the item to

item$ - text of the new item

select (optional) - True to make the new item the current selection; False (default) leaves the selection alone

icon (optional) - zero-based index into the gadget's icon strip; -1 for no icon (default)

Description

Appends an item to a combo box, list box or tabber.

Requires Extended language mode.

Combo boxes, list boxes and tabbers all manage a numbered list of items, and AddGadgetItem is the shared way to fill them: each call appends one item to the end. In a tabber, every item is a tab. Item text crosses the runtime as UTF-8, so any Unicode label works.

Items are indexed from 0 in the order they were added. Those indexes are what SelectedGadgetItem, GadgetItemText and friends deal in, and they shift when you insert or remove items, so do not cache them across list edits.

To show an icon next to the item, first assign an icon strip to the gadget with SetGadgetIconStrip, then pass the strip index here.

Adding or selecting items from code is silent: only the user's own clicks post gadget-action events ($401), so filling a list at startup will not flood your event loop.

See it working in the layout and controls sample; the world editor shell sample shows the editor pattern around it.

See also: InsertGadgetItem, ModifyGadgetItem, RemoveGadgetItem, ClearGadgetItems, CountGadgetItems, SelectGadgetItem.

Index