application/main.c

branch
newapi
changeset 279
2ad83650d797
parent 278
a8faf8757450
--- a/application/main.c	Sun Apr 07 12:36:07 2024 +0200
+++ b/application/main.c	Sun Apr 07 13:24:26 2024 +0200
@@ -49,14 +49,16 @@
     
 }
 
+void action_file_selected(UiEvent *event, void *userdata) {
+    UiFileList *files = event->eventdata;
+    printf("files: %d\n", (int)files->nfiles);
+    if(files->nfiles > 0) {
+        printf("selected file: %s\n", files->files[0]);
+    }
+}
+
 void action_button(UiEvent *event, void *userdata) {
-    ui_dialog(event->obj,
-            .title = "My Title",
-            .button1_label = "OK",
-            .button2_label = "Test",
-            .closebutton_label = "Cancel",
-            .content = "Hello World!",
-            .input = true);
+    ui_openfiledialog(event->obj, UI_FILEDIALOG_SELECT_SINGLE, action_file_selected, NULL);
 }
 
 void action_switch(UiEvent *event, void *userdata) {

mercurial