ui/motif/tree.c

branch
newapi
changeset 176
bc63cb601f6d
parent 157
0b33b9396851
--- a/ui/motif/tree.c	Mon May 22 19:44:27 2023 +0200
+++ b/ui/motif/tree.c	Mon May 22 21:21:20 2023 +0200
@@ -36,7 +36,9 @@
 #include "container.h"
 #include "../common/object.h"
 #include "../common/context.h"
-#include <ucx/utils.h>
+#include <cx/utils.h>
+#include <cx/compare.h>
+#include <cx/printf.h>
 
 UIWIDGET ui_table_var(UiObject *obj, UiVar *var, UiModel *model, UiListCallbacks cb) {
     // TODO: check if modelinfo is complete
@@ -119,7 +121,7 @@
         data = list->next(list);
     }
     
-    UiTableView *tableview = ucx_mempool_malloc(obj->ctx->mempool, sizeof(UiTableView));
+    UiTableView *tableview = cxMalloc(obj->ctx->allocator, sizeof(UiTableView));
     tableview->widget = container;
     tableview->var = var;
     tableview->model = model;
@@ -246,9 +248,11 @@
         case UI_INTEGER: {
             *free = TRUE;
             int *val = data;
-            sstr_t str = ucx_asprintf(ucx_default_allocator(), "%d", *val);
+            cxmutstr str = cx_asprintf("%d", *val);
             return str.ptr;
         }
+        case UI_ICON: break; // TODO
+        case UI_ICON_TEXT: break; // TODO
     }
     *free = FALSE;
     return NULL;

mercurial