diff -r 39b9b86ec452 -r 19d37cb9c96c application/main.c --- a/application/main.c Sat Mar 22 15:34:20 2014 +0100 +++ b/application/main.c Sat Mar 22 19:45:44 2014 +0100 @@ -38,6 +38,7 @@ typedef struct TestWindowData { TestDocument *doc1; TestDocument *doc2; + UiText text; } TestWindowData; UiInteger check1; @@ -54,6 +55,12 @@ printf("check1: %s\n", ui_getval(doc->check1) ? "true" : "false"); } +void action_save(UiEvent *event, void *data) { + TestWindowData *wd = event->window; + printf("Text: {%s}\n", ui_getval(wd->text)); + ui_setval(wd->text, "--------"); +} + void action_close(UiEvent *event, void *data) { exit(0); } @@ -87,10 +94,12 @@ ui_toolitem_st("new", UI_STOCK_NEW, action_new, NULL); ui_toolitem_st("open", UI_STOCK_OPEN, action_open, NULL); + ui_toolitem_st("save", UI_STOCK_SAVE, action_save, NULL); ui_toolitem_st("close", UI_STOCK_CLOSE, action_close, NULL); ui_toolbar_add_default("new"); ui_toolbar_add_default("open"); + ui_toolbar_add_default("save"); ui_toolbar_add_default("close"); @@ -107,7 +116,8 @@ ui_set_document(window, doc1); - ui_button(window, "OK", action_open, NULL); + //ui_button(window, "OK", action_open, NULL); + ui_textarea(window, &wdata->text); //ui_window_addint(window, "check1"); ui_show(window);