32 |
32 |
33 #include "../ui/window.h" |
33 #include "../ui/window.h" |
34 #include "../ui/properties.h" |
34 #include "../ui/properties.h" |
35 #include "../common/context.h" |
35 #include "../common/context.h" |
36 |
36 |
|
37 #include <cx/basic_mempool.h> |
|
38 |
37 #include "menu.h" |
39 #include "menu.h" |
38 #include "toolbar.h" |
40 #include "toolbar.h" |
39 #include "container.h" |
41 #include "container.h" |
40 |
42 |
41 static int nwindows = 0; |
43 static int nwindows = 0; |
64 } |
66 } |
65 #endif |
67 #endif |
66 } |
68 } |
67 |
69 |
68 static UiObject* create_window(char *title, void *window_data, UiBool simple) { |
70 static UiObject* create_window(char *title, void *window_data, UiBool simple) { |
69 UcxMempool *mp = ucx_mempool_new(256); |
71 CxMempool *mp = cxBasicMempoolCreate(256); |
70 UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); |
72 UiObject *obj = cxCalloc(mp->allocator, 1, sizeof(UiObject)); |
71 |
73 |
72 #ifndef UI_GTK2 |
74 #ifndef UI_GTK2 |
73 obj->widget = gtk_application_window_new(ui_get_application()); |
75 obj->widget = gtk_application_window_new(ui_get_application()); |
74 #else |
76 #else |
75 obj->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
77 obj->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
76 #endif |
78 #endif |
77 |
79 |
78 |
80 |
79 obj->ctx = uic_context(obj, mp); |
81 obj->ctx = uic_context(obj, mp->allocator); |
80 obj->window = window_data; |
82 obj->window = window_data; |
81 |
83 |
82 if(title != NULL) { |
84 if(title != NULL) { |
83 gtk_window_set_title(GTK_WINDOW(obj->widget), title); |
85 gtk_window_set_title(GTK_WINDOW(obj->widget), title); |
84 } |
86 } |