40 |
40 |
41 static int window_default_width = 600; |
41 static int window_default_width = 600; |
42 static int window_default_height = 500; |
42 static int window_default_height = 500; |
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 UiObject *obj = udata; |
|
46 UiEvent ev; |
|
47 ev.window = obj->window; |
|
48 ev.document = obj->ctx->document; |
|
49 ev.obj = obj; |
|
50 ev.eventdata = NULL; |
|
51 ev.intval = 0; |
|
52 |
|
53 if(obj->ctx->close_callback) { |
|
54 obj->ctx->close_callback(&ev, obj->ctx->close_data); |
|
55 } |
|
56 // TODO: free UiObject |
|
57 |
45 nwindows--; |
58 nwindows--; |
46 if(nwindows == 0) { |
59 if(nwindows == 0) { |
47 ui_exit_mainloop(); |
60 ui_exit_mainloop(); |
48 } |
61 } |
49 } |
62 } |