ListBox

ListBoxAddItem

Append an item to the list box

Syntax

Signature
xBool        ListBoxAddItem( ListBox *listBox, const char *text, const char *data );

Arguments

listBox the list box.

text the UTF-8 item text to copy. NULL is invalid. An empty string is allowed.

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 or text is NULL.

Description

The list stores its own copies of the strings. Appending the first item sets the first visible position to `1`. The list synchronizes its scroll bar after the append.

Call `ListBoxDisplay()` to redraw and `ListBoxSelect()` to select an item.

See also