application/main.c

changeset 1245
4163776eef49
parent 1244
a29b53f97d1a
--- a/application/main.c	Wed Sep 09 18:57:52 2026 +0200
+++ b/application/main.c	Thu Sep 10 17:36:06 2026 +0200
@@ -575,6 +575,11 @@
     return node->name;
 }
 
+void sourcelist2_getvalue(UiList *list, void *elm, int index, UiSubListItem *item, void *userdata) {
+    TreeNode *node = elm;
+    item->label = node->name;
+}
+
 int tree_getdepth(UiList *list, void *elm, int row, void *userdata) {
     TreeNode *node = elm;
     return node->depth;
@@ -950,8 +955,10 @@
             ui_drawingarea(obj, .fill = TRUE, .draw = draw);
         }
         ui_tab(obj, "Tab 13") {
-            UiModel *model = ui_model(obj->ctx, UI_STRING, "test", -1);
-            ui_treeview(obj, .fill = TRUE, .model = model, .show_header = TRUE, .getvalue = tree_getvalue, .getdepth = tree_getdepth, .varname = "tree");
+            //UiModel *model = ui_model(obj->ctx, UI_STRING, "test", -1);
+            //ui_treeview(obj, .fill = TRUE, .model = model, .show_header = TRUE, .getvalue = tree_getvalue, .getdepth = tree_getdepth, .varname = "tree");
+            
+            ui_sourcelist2(obj, .fill = TRUE, .getvalue = sourcelist2_getvalue, .getdepth = tree_getdepth, .varname = "tree");
         }
     }
     

mercurial