ui/common/object.c

changeset 627
3f0c9fe60c68
parent 626
724c7036a03e
child 659
d6baaa93f7be
--- a/ui/common/object.c	Mon Jun 16 21:21:00 2025 +0200
+++ b/ui/common/object.c	Mon Jun 16 21:41:55 2025 +0200
@@ -131,6 +131,14 @@
     cxMempoolFree(obj->ctx->mp);
 }
 
+UiObject* uic_object_new_toplevel(void) {
+    CxMempool *mp = cxMempoolCreateSimple(256);
+    UiObject *obj = cxCalloc(mp->allocator, 1, sizeof(UiObject));
+    obj->ctx = uic_context(obj, mp);
+    uic_object_created(obj);
+    return obj;
+}
+
 UiObject* uic_object_new(UiObject *toplevel, UIWIDGET widget) {
     return uic_ctx_object_new(toplevel->ctx, widget);
 }

mercurial