ui/gtk/window.c

changeset 133
6dd780cbc8c6
parent 128
c284c15509a8
child 134
69e8e0936858
--- a/ui/gtk/window.c	Sun Jan 15 15:08:07 2017 +0100
+++ b/ui/gtk/window.c	Sun Jan 22 11:16:21 2017 +0100
@@ -58,15 +58,24 @@
     // TODO: free UiObject
     
     nwindows--;
+#ifdef GTK2_LEGACY
     if(nwindows == 0) {
         gtk_main_quit();
     }
+#endif
 }
 
 static UiObject* create_window(char *title, void *window_data, UiBool simple) {
     UcxMempool *mp = ucx_mempool_new(256);
-    UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject));  
+    UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); 
+    
+#ifndef GTK2_LEGACY
+    obj->widget = gtk_application_window_new(ui_get_application());
+#else
     obj->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+#endif
+    
+    
     obj->ctx = uic_context(obj, mp);
     obj->window = window_data;
     

mercurial