--- a/application/main.c Sat Mar 22 19:45:44 2014 +0100 +++ b/application/main.c Mon Mar 24 11:21:59 2014 +0100 @@ -79,6 +79,17 @@ } } +void action_undo(UiEvent *event, void *data) { + printf("undo\n"); + TestWindowData *wd = event->window; + ui_text_undo(&wd->text); +} + +void action_redo(UiEvent *event, void *data) { + printf("redo\n"); +} + + int main(int argc, char** argv) { ui_init("app1", argc, argv); @@ -96,11 +107,15 @@ 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_toolitem_st("undo", UI_STOCK_UNDO, action_undo, NULL); + ui_toolitem_st("redo", UI_STOCK_REDO, action_redo, NULL); ui_toolbar_add_default("new"); ui_toolbar_add_default("open"); ui_toolbar_add_default("save"); ui_toolbar_add_default("close"); + ui_toolbar_add_default("undo"); + ui_toolbar_add_default("redo"); UiObject *window = ui_window("Mod0", NULL);