ui/common/types.c

branch
newapi
changeset 248
22257f5f4019
parent 246
b19f3098dd11
child 251
22dc0b739dd8
--- a/ui/common/types.c	Thu Feb 08 10:17:59 2024 +0100
+++ b/ui/common/types.c	Fri Feb 09 15:45:02 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