# HG changeset patch # User Olaf Wintermann # Date 1756541686 -7200 # Node ID 3ad4792ffadcffe5ef0981a33e689e23e7403a42 # Parent c249b497ab2ebc481985381a605921af20194467 add alternative function for setting list selections diff -r c249b497ab2e -r 3ad4792ffadc ui/common/wrapper.c --- a/ui/common/wrapper.c Thu Aug 28 20:12:43 2025 +0200 +++ b/ui/common/wrapper.c Sat Aug 30 10:14:46 2025 +0200 @@ -236,6 +236,15 @@ return sel->rows; } +UIEXPORT void ui_list_set_selected_indices(UiList *list, int *indices, int num) { + UiListSelection sel; + sel.rows = indices; + sel.count = num; + if(list->setselection) { + list->setselection(list, sel); + } +} + void ui_list_selection_free(UiListSelection *sel) { ui_listselection_free(*sel); free(sel); diff -r c249b497ab2e -r 3ad4792ffadc ui/common/wrapper.h --- a/ui/common/wrapper.h Thu Aug 28 20:12:43 2025 +0200 +++ b/ui/common/wrapper.h Sat Aug 30 10:14:46 2025 +0200 @@ -77,6 +77,7 @@ UIEXPORT UiListSelection* ui_list_get_selection_allocated(UiList *list); UIEXPORT int ui_list_selection_get_count(UiListSelection *sel); UIEXPORT int* ui_list_selection_get_rows(UiListSelection *sel); +UIEXPORT void ui_list_set_selected_indices(UiList *list, int *indices, int num); UIEXPORT void ui_list_selection_free(UiListSelection *sel); UIEXPORT int ui_filelist_count(UiFileList *flist);