Blitz3D+ Command Reference

ModifyGadgetItem gadget,index,item$[,icon]

Parameters

gadget - combo box, list box or tabber

index - item to change, starting at 0

item$ - new item text

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

Description

Replaces the text and icon of an existing item in a combo box, list box or tabber.

The item stays where it is and keeps its selection state - only its text and icon change. That makes this the right tool for live updates: renaming an asset in a level editor's list, updating a tab caption, or refreshing a status column without rebuilding the whole list from scratch.

Gotcha: the icon parameter always takes effect. Its default is -1 (no icon), so calling ModifyGadgetItem without the icon argument removes an icon the item already had - pass the icon index again if you want to keep it.

Icons come from the strip attached with SetGadgetIconStrip. An index outside 0 to CountGadgetItems()-1 stops with a runtime error, and the change itself posts no event to the queue.

Requires Extended mode.

See also: AddGadgetItem, InsertGadgetItem, RemoveGadgetItem, GadgetItemText, CountGadgetItems, SetGadgetIconStrip.

Index