ListBox

ListBoxInsItem

Insert an item before an existing position in the list box

Syntax

Signature
xBool        ListBoxInsItem( ListBox *listBox, int position, const char *text, const char *data );

Arguments

listBox the list box.

position the one-based position of an existing item.

text the UTF-8 item text to copy. NULL is invalid.

data the associated string to copy, or NULL for an item without data.

Return value

T on success, or F if the object is NULL, text is NULL or position is outside the existing item list.

Description

The list copies the item strings and shifts subsequent items one position later. If the selected item moves, its stored position is adjusted. The list synchronizes its scroll bar. Use `ListBoxAddItem()` to append or add the first item, and call `ListBoxDisplay()` to redraw.

See also