diff -r c08c2c9f11b3 -r 02af1d4a88df ui/common/types.c --- a/ui/common/types.c Fri Jan 23 16:25:39 2026 +0100 +++ b/ui/common/types.c Sun Jan 25 10:28:37 2026 +0100 @@ -196,6 +196,12 @@ } } +UIEXPORT void ui_list_set_selection(UiList *list, UiListSelection sel) { + if(list->setselection) { + list->setselection(list, sel); + } +} + void ui_list_addobsv(UiList *list, ui_callback f, void *data) { list->observers = ui_add_observer(list->observers, f, data); } @@ -789,11 +795,16 @@ } -UIEXPORT UiListSelection ui_list_getselection(UiList *list) { +UIEXPORT int ui_list_getselection(UiList *list) { + int selection = -1; if (list->getselection) { - return list->getselection(list); + UiListSelection sel = list->getselection(list); + if(sel.count > 0) { + selection = sel.rows[0]; + } + ui_listselection_free(sel); } - return (UiListSelection){ 0, NULL }; + return selection; } UIEXPORT void ui_list_setselection(UiList *list, int index) {