56 obj->ctx->close_callback(&ev, obj->ctx->close_data); |
56 obj->ctx->close_callback(&ev, obj->ctx->close_data); |
57 } |
57 } |
58 // TODO: free UiObject |
58 // TODO: free UiObject |
59 |
59 |
60 nwindows--; |
60 nwindows--; |
61 #ifdef GTK2_LEGACY |
61 #ifdef UI_GTK2 |
62 if(nwindows == 0) { |
62 if(nwindows == 0) { |
63 gtk_main_quit(); |
63 gtk_main_quit(); |
64 } |
64 } |
65 #endif |
65 #endif |
66 } |
66 } |
67 |
67 |
68 static UiObject* create_window(char *title, void *window_data, UiBool simple) { |
68 static UiObject* create_window(char *title, void *window_data, UiBool simple) { |
69 UcxMempool *mp = ucx_mempool_new(256); |
69 UcxMempool *mp = ucx_mempool_new(256); |
70 UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); |
70 UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); |
71 |
71 |
72 #ifndef GTK2_LEGACY |
72 #ifndef UI_GTK2 |
73 obj->widget = gtk_application_window_new(ui_get_application()); |
73 obj->widget = gtk_application_window_new(ui_get_application()); |
74 #else |
74 #else |
75 obj->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
75 obj->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
76 #endif |
76 #endif |
77 |
77 |