--- a/ui/common/types.c Thu Feb 08 10:35:07 2024 +0100 +++ b/ui/common/types.c Fri Feb 09 16:50:23 2024 +0100 @@ -104,6 +104,7 @@ list->iter = NULL; list->update = NULL; + list->getselection = NULL; list->obj = NULL; if(name) { @@ -458,6 +459,18 @@ } +UIEXPORT UiListSelection ui_list_getselection(UiList *list) { + if (list->getselection) { + return list->getselection(list); + } + return (UiListSelection){ 0, NULL }; +} + +UIEXPORT void ui_listselection_free(UiListSelection selection) { + if (selection.rows) { + free(selection.rows); + } +} UIEXPORT UiStr ui_str(char *cstr) { return (UiStr) { cstr, NULL };