diff -r c51e58359db8 -r 681b930abe84 ui/common/types.c --- a/ui/common/types.c Sun Oct 27 11:34:25 2024 +0100 +++ b/ui/common/types.c Sun Oct 27 12:08:10 2024 +0100 @@ -501,6 +501,15 @@ return (UiListSelection){ 0, NULL }; } +UIEXPORT void ui_list_setselection(UiList *list, int index) { + if (list->setselection && index >= 0) { + UiListSelection sel; + sel.count = 1; + sel.rows = &index; + list->setselection(list, sel); + } +} + UIEXPORT void ui_listselection_free(UiListSelection selection) { if (selection.rows) { free(selection.rows);