ui/win32/window.c

changeset 1035
86d3a45dc928
parent 997
287b20e2a564
equal deleted inserted replaced
1034:330b415910bd 1035:86d3a45dc928
27 */ 27 */
28 28
29 #include "window.h" 29 #include "window.h"
30 #include <Windows.h> 30 #include <Windows.h>
31 31
32 #include "toolkit.h"
32 #include "container.h" 33 #include "container.h"
33 34
34 #include "../common/object.h" 35 #include "../common/object.h"
35 36
36 37
68 MessageBox(NULL, "RegisterClassEx failed", "Error", MB_ICONERROR); 69 MessageBox(NULL, "RegisterClassEx failed", "Error", MB_ICONERROR);
69 exit(-1); 70 exit(-1);
70 } 71 }
71 } 72 }
72 73
74 UiWindow* ui_widget2window(W32Widget *widget) {
75 if (widget->wclass != &w32_toplevel_widget_class) {
76 return NULL;
77 }
78 return (UiWindow*)widget;
79 }
80
73 static UiObject* create_window(const char *title, bool simple) { 81 static UiObject* create_window(const char *title, bool simple) {
74 UiObject *obj = uic_object_new_toplevel(); 82 UiObject *obj = uic_object_new_toplevel();
83 obj->ctx->command_map = cxHashMapCreate(obj->ctx->allocator, sizeof(UiCommand), 64);
75 84
76 HWND hwnd = CreateWindowExA( 85 HWND hwnd = CreateWindowExA(
77 0, 86 0,
78 "UiMainWindow", 87 "UiMainWindow",
79 title, 88 title,

mercurial