well it is at least a wip

main
Bel LaPointe 2023-12-27 21:01:54 -05:00
parent 7e03cf11a6
commit 46ca6064c3
2 changed files with 13 additions and 1 deletions

1
src/bel_1_1.mp4 Symbolic link
View File

@ -0,0 +1 @@
/Users/breel/Movies/bel_1_1.mp4

View File

@ -1,7 +1,7 @@
#![allow(non_snake_case)]
// import the prelude to get access to the `rsx!` macro and the `Scope` and `Element` types
use dioxus::prelude::*;
use nfd;
use rfd::AsyncFileDialog;
fn main() {
// launch the dioxus app in a webview
@ -22,6 +22,17 @@ fn App(cx: Scope) -> Element {
input {
r#type: "button",
value: "pick file", onclick: move |evt| {
to_owned![file];
async move {
match AsyncFileDialog::new()
.pick_file()
.await {
Some(f) => {
file.set(f.file_name().clone()); // TODO swap to .path() on desktop
},
None => { file.set(format!("<<failed to pick a file>>")); },
};
}
},
},
p { file.get().clone() }