ui/cocoa/window.m

changeset 851
367b2bbbc07e
parent 832
7adbd6b7bf7c
child 864
d39301e8f962
--- a/ui/cocoa/window.m	Wed Oct 15 18:50:52 2025 +0200
+++ b/ui/cocoa/window.m	Thu Oct 16 10:48:16 2025 +0200
@@ -38,16 +38,13 @@
 #include "../common/context.h"
 #include "../common/menu.h"
 #include "../common/toolbar.h"
+#include "../common/object.h"
 
 #include <cx/mempool.h>
 
 
 static UiObject* create_window(const char *title, BOOL simple, BOOL sidebar, BOOL splitview) {
-    CxMempool *mp = cxMempoolCreateSimple(256);
-    UiObject *obj = cxCalloc(mp->allocator, 1, sizeof(UiObject));
-    obj->ref = 0;
-    
-    obj->ctx = uic_context(obj, mp);
+    UiObject *obj = uic_object_new_toplevel();
     
     MainWindow *window = [[MainWindow alloc] init:obj withSidebar:sidebar withSplitview:splitview];
     [[WindowManager sharedWindowManager] addWindow:window];

mercurial