ui/common/types.c

changeset 26
40d6af793c1a
parent 19
813c97c5b6d3
child 27
c254ed644edf
--- 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 };

mercurial