well it is at least a wip
This commit is contained in:
1
src/bel_1_1.mp4
Symbolic link
1
src/bel_1_1.mp4
Symbolic link
@@ -0,0 +1 @@
|
||||
/Users/breel/Movies/bel_1_1.mp4
|
||||
@@ -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() }
|
||||
|
||||
Reference in New Issue
Block a user