C4 Engine
C4 Engine API Documentation

ListWidget::PrependListItem

Defined in:  C4Widgets.h
Adds an item to the beginning of a list.
Prototype

void PrependListItem(Widget *widget);

TextWidget *PrependListItem(const char *text);

Parameters
widget The widget to add to the list.
text The text used to add a text widget to the list.
Description
The PrependListItem function adds an item to the beginning of a list. If the widget parameter is specified, then that widget is added directly to the list. If the text parameter is specified, then a new TextWidget item is created with the text string and the default font and added to the list. In this case, a pointer to the new text widget is returned.

Note that unless that kListItemsEnabled flag has been set with the ListWidget::SetListFlags function, the widget added to the list is disabled before the PrependListItem function returns so that clicks go through to the list widget. To allow a widget in a list or any of its subwidgets to receive events, call the Widget::EnableWidget function for that widget after adding it to the list.
See Also

ListWidget::AppendListItem