ui/gtk/toolkit.c

branch
newapi
changeset 174
0358f1d9c506
parent 167
161511838ea6
child 253
087cc9216f28
equal deleted inserted replaced
173:809581724cc7 174:0358f1d9c506
36 #include "model.h" 36 #include "model.h"
37 #include "image.h" 37 #include "image.h"
38 #include "../common/document.h" 38 #include "../common/document.h"
39 #include "../common/properties.h" 39 #include "../common/properties.h"
40 40
41 #include <ucx/utils.h> 41 #include <cx/utils.h>
42 #include <cx/string.h>
43 #include <cx/printf.h>
42 44
43 #include <pthread.h> 45 #include <pthread.h>
44 46
45 #ifndef UI_GTK2 47 #ifndef UI_GTK2
46 static GtkApplication *app; 48 static GtkApplication *app;
116 } 118 }
117 #endif 119 #endif
118 120
119 void ui_main() { 121 void ui_main() {
120 #ifndef UI_GTK2 122 #ifndef UI_GTK2
121 sstr_t appid = ucx_sprintf( 123 cxmutstr appid = cx_asprintf(
122 "ui.%s", 124 "ui.%s",
123 application_name ? application_name : "application1"); 125 application_name ? application_name : "application1");
124 126
125 app = gtk_application_new( 127 app = gtk_application_new(
126 appid.ptr, 128 appid.ptr,
244 ui_destroy_boundvar(data->obj->ctx, data->var); 246 ui_destroy_boundvar(data->obj->ctx, data->var);
245 free(data); 247 free(data);
246 } 248 }
247 249
248 void ui_destroy_boundvar(UiContext *ctx, UiVar *var) { 250 void ui_destroy_boundvar(UiContext *ctx, UiVar *var) {
251 uic_unbind_var(var);
252
249 if(var->type == UI_VAR_SPECIAL) { 253 if(var->type == UI_VAR_SPECIAL) {
250 free(var); 254 free(var);
251 } else { 255 } else {
252 uic_remove_bound_var(ctx, var); 256 ui_free(var->from_ctx, var);
257 // TODO: free or unbound
258 //uic_remove_bound_var(ctx, var);
253 } 259 }
254 } 260 }
255 261
256 void ui_set_active_window(UiObject *obj) { 262 void ui_set_active_window(UiObject *obj) {
257 active_window = obj; 263 active_window = obj;

mercurial