application/main.c

branch
newapi
changeset 279
2ad83650d797
parent 278
a8faf8757450
equal deleted inserted replaced
278:a8faf8757450 279:2ad83650d797
47 47
48 void action_menu(UiEvent *event, void *userdata) { 48 void action_menu(UiEvent *event, void *userdata) {
49 49
50 } 50 }
51 51
52 void action_file_selected(UiEvent *event, void *userdata) {
53 UiFileList *files = event->eventdata;
54 printf("files: %d\n", (int)files->nfiles);
55 if(files->nfiles > 0) {
56 printf("selected file: %s\n", files->files[0]);
57 }
58 }
59
52 void action_button(UiEvent *event, void *userdata) { 60 void action_button(UiEvent *event, void *userdata) {
53 ui_dialog(event->obj, 61 ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_SINGLE, action_file_selected, NULL);
54 .title = "My Title",
55 .button1_label = "OK",
56 .button2_label = "Test",
57 .closebutton_label = "Cancel",
58 .content = "Hello World!",
59 .input = true);
60 } 62 }
61 63
62 void action_switch(UiEvent *event, void *userdata) { 64 void action_switch(UiEvent *event, void *userdata) {
63 65
64 } 66 }

mercurial