C4 Engine
C4 Engine API Documentation

ListWidget::SelectListItem

Defined in:  C4Widgets.h
Selects an item in a list.
Prototype

void SelectListItem(int32 index, bool post = false);

Parameters
index The index of the item to select.
post Indicates whether to post a kEventWidgetChange event.
Description
The SelectListItem function selects the list item whose zero-based index is specified by the index parameter. If the index parameter is not in the range [0, n − 1], where n is the number of items in the list, then no new selection is made.

If the kListMultipleSelection is not set for the list widget, then all list items having an index other than that specified by the index parameter are unselected. In the case that the index is out of range, this means that all of the list items are unselected.

If the post parameter is true and a change was actually made to the selection, then the list widget posts a kEventWidgetChange event that can be handled by its observers.
See Also

ListWidget::UnselectListItem

ListWidget::SelectAllListItems

ListWidget::UnselectAllListItems

ListWidget::GetFirstSelectedListItem

ListWidget::GetLastSelectedListItem

ListWidget::GetSelectedListItem

ListWidget::GetSelectedListItemCount

ListWidget::GetListItemCount

ListWidget::GetListFlags

ListWidget::SetListFlags

ListWidget::RevealListItem