ui/motif/window.c

changeset 36
e4198fc2ead4
parent 28
794a5c91c479
child 60
7cd1b8890302
equal deleted inserted replaced
35:3e8b5c9b4033 36:e4198fc2ead4
42 static int window_default_height = 550; 42 static int window_default_height = 550;
43 43
44 static void window_close_handler(Widget window, void *udata, void *cdata) { 44 static void window_close_handler(Widget window, void *udata, void *cdata) {
45 nwindows--; 45 nwindows--;
46 if(nwindows == 0) { 46 if(nwindows == 0) {
47 exit(0); 47 ui_exit_mainloop();
48 } 48 }
49 } 49 }
50 50
51 UiObject* ui_window(char *title, void *window_data) { 51 UiObject* ui_window(char *title, void *window_data) {
52 UcxMempool *mp = ucx_mempool_new(256); 52 UcxMempool *mp = ucx_mempool_new(256);
126 obj->widget = toplevel; 126 obj->widget = toplevel;
127 nwindows++; 127 nwindows++;
128 return obj; 128 return obj;
129 } 129 }
130 130
131 void ui_close(UiObject *obj) {
132 XtDestroyWidget(obj->widget);
133 window_close_handler(obj->widget, obj, NULL);
134 }
135
131 typedef struct FileDialogData { 136 typedef struct FileDialogData {
132 int running; 137 int running;
133 char *file; 138 char *file;
134 } FileDialogData; 139 } FileDialogData;
135 140

mercurial