ui/win32/window.c

changeset 118
6d0da97105d8
parent 115
e57ca2747782
--- a/ui/win32/window.c	Sat Dec 27 22:47:56 2025 +0100
+++ b/ui/win32/window.c	Thu Jan 08 18:06:04 2026 +0100
@@ -29,6 +29,7 @@
 #include "window.h"
 #include <Windows.h>
 
+#include "toolkit.h"
 #include "container.h"
 
 #include "../common/object.h"
@@ -70,8 +71,16 @@
     }
 }
 
+UiWindow* ui_widget2window(W32Widget *widget) {
+    if (widget->wclass != &w32_toplevel_widget_class) {
+        return NULL;
+    }
+    return (UiWindow*)widget;
+}
+
 static UiObject* create_window(const char *title, bool simple) {
     UiObject *obj = uic_object_new_toplevel();
+    obj->ctx->command_map = cxHashMapCreate(obj->ctx->allocator, sizeof(UiCommand), 64);
 
     HWND hwnd = CreateWindowExA(
             0,

mercurial