application/window.c

changeset 3
c04433993fbb
parent 2
ea89bbb0c4c8
child 4
d8e8f34e65ee
equal deleted inserted replaced
2:ea89bbb0c4c8 3:c04433993fbb
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "window.h" 29 #include "window.h"
30 #include "menu.h" 30 #include "menu.h"
31 #include "browser.h"
31 32
32 #include <stdio.h> 33 #include <stdio.h>
33 #include <stdlib.h> 34 #include <stdlib.h>
34 35
35 UiObject* window_create(void) { 36 UiObject* window_create(void) {
36 UiObject *obj = ui_window("Note", NULL); 37 UiObject *obj = ui_window("Note", NULL);
37 WindowData *window = ui_malloc(obj->ctx, sizeof(WindowData)); 38 WindowData *window = ui_malloc(obj->ctx, sizeof(WindowData));
39 memset(window, 0, sizeof(WindowData));
38 obj->window = window; 40 obj->window = window;
39 41
40 UI_CTN(obj, ui_hsplitpane(obj, 3)) { 42 UI_CTN(obj, ui_hsplitpane(obj, 3)) {
41 ui_layout_width(obj, 160); 43 ui_layout_width(obj, 160);
42 window->sidebar = ui_vbox(obj); 44 window->sidebar = ui_vbox(obj);
43 UI_CTN(obj,(void)0) { 45 UI_CTN(obj,(void)0) {
44 ui_listview_nv(obj, "notebooks", NULL, NULL, NULL); 46 ui_listview_nv(obj, "notebooks", NULL, NULL, NULL);
45 } 47 }
46 48
47 window->browser = ui_label(obj, "Browser"); 49 window->browser = document_browser_create(obj);
48 50
49 window->editor = ui_textarea_nv(obj, "text"); 51 window->editor = ui_textarea_nv(obj, "text");
52 ui_widget_set_groups(obj->ctx, ui_textarea_gettextwidget(window->editor), (ui_enablefunc)ui_set_enabled, APPGR_DOCUMENT_OPEN, -1);
50 } 53 }
51 54
52 return obj; 55 return obj;
53 } 56 }
54 57

mercurial