ui/gtk/window.c

branch
newapi
changeset 253
087cc9216f28
parent 174
0358f1d9c506
child 254
13997c76859b
--- a/ui/gtk/window.c	Sun Feb 11 15:44:33 2024 +0100
+++ b/ui/gtk/window.c	Sun Feb 11 22:06:23 2024 +0100
@@ -34,7 +34,7 @@
 #include "../ui/properties.h"
 #include "../common/context.h"
 
-#include <cx/basic_mempool.h>
+#include <cx/mempool.h>
 
 #include "menu.h"
 #include "toolbar.h"
@@ -67,7 +67,7 @@
 #endif
 }
 
-static UiObject* create_window(char *title, void *window_data, UiBool simple) {
+static UiObject* create_window(const char *title, void *window_data, UiBool simple) {
     CxMempool *mp = cxBasicMempoolCreate(256);
     UiObject *obj = cxCalloc(mp->allocator, 1, sizeof(UiObject)); 
     
@@ -78,7 +78,7 @@
 #endif
     
     
-    obj->ctx = uic_context(obj, mp->allocator);
+    obj->ctx = uic_context(obj, mp);
     obj->window = window_data;
     
     if(title != NULL) {
@@ -138,11 +138,11 @@
 }
 
 
-UiObject* ui_window(char *title, void *window_data) {
+UiObject* ui_window(const char *title, void *window_data) {
     return create_window(title, window_data, FALSE);
 }
 
-UiObject* ui_simplewindow(char *title, void *window_data) {
+UiObject* ui_simplewindow(const char *title, void *window_data) {
     return create_window(title, window_data, TRUE);
 }
 
@@ -179,11 +179,4 @@
     }
 }
 
-char* ui_openfiledialog(UiObject *obj) {
-    return ui_gtkfilechooser(obj, GTK_FILE_CHOOSER_ACTION_OPEN);
-}
 
-char* ui_savefiledialog(UiObject *obj) {
-    return ui_gtkfilechooser(obj, GTK_FILE_CHOOSER_ACTION_SAVE);
-}
-

mercurial