application/main.c

changeset 142
46448d38885c
parent 140
c03c338a7dcf
child 143
d499b29d7cb6
equal deleted inserted replaced
141:cc2170ea05ad 142:46448d38885c
74 74
75 Document* create_doc() { 75 Document* create_doc() {
76 Document *doc = ui_document_new(sizeof(Document)); 76 Document *doc = ui_document_new(sizeof(Document));
77 UiContext *ctx = ui_document_context(doc); 77 UiContext *ctx = ui_document_context(doc);
78 78
79 doc->text = ui_text_new(ctx, "text"); 79 //doc->text = ui_text_new(ctx, "text");
80 //doc->t1 = ui_string_new(ctx, "t1"); 80 //doc->t1 = ui_string_new(ctx, "t1");
81 //doc->t2 = ui_string_new(ctx, "t2"); 81 //doc->t2 = ui_string_new(ctx, "t2");
82 //doc->t3 = ui_string_new(ctx, "t3"); 82 //doc->t3 = ui_string_new(ctx, "t3");
83 83
84 //doc->i = ui_int_new(ctx, "int"); 84 doc->i = ui_int_new(ctx, "int");
85 return doc; 85 return doc;
86 } 86 }
87 87
88 void action_newdoc(UiEvent *event, void *data) { 88 void action_newdoc(UiEvent *event, void *data) {
89 printf("new doc\n"); 89 printf("new doc\n");
99 d2 = create_doc(); 99 d2 = create_doc();
100 100
101 UiObject *obj = ui_window("Test", NULL); 101 UiObject *obj = ui_window("Test", NULL);
102 ui_set_document(obj, d1); 102 ui_set_document(obj, d1);
103 103
104 ui_textarea_nv(obj, "text"); 104 //ui_textarea_nv(obj, "text");
105 105 ui_radiobutton_nv(obj, "1", "int");
106 106 ui_radiobutton_nv(obj, "2", "int");
107 ui_radiobutton_nv(obj, "3", "int");
107 108
108 ui_button(obj, "Switch Document", action_newdoc, NULL); 109 ui_button(obj, "Switch Document", action_newdoc, NULL);
109 110
110 ui_show(obj); 111 ui_show(obj);
111 } 112 }

mercurial