ListBox

ListBoxSetTopItem

Set which item appears first in the list viewport

Syntax

Signature
xBool        ListBoxSetTopItem( ListBox *listBox, int topItem );

Arguments

listBox the list box.

topItem the one-based position of an existing item.

Return value

T on success, or F if the object is NULL or topItem is outside the item list.

Description

The setter changes the first displayed position and synchronizes the attached scroll bar. The selected position is independent of the viewport. Call `ListBoxDisplay()` to draw from the new top item. Positions near the end can leave empty rows below the last item.

See also