dioxus/examples/filedragdrop.rs

18 lines
349 B
Rust
Raw Normal View History

2024-01-20 00:36:40 +00:00
use dioxus::desktop::Config;
2022-01-10 17:57:39 +00:00
use dioxus::prelude::*;
fn main() {
2024-01-18 20:32:01 +00:00
LaunchBuilder::desktop()
.with_cfg(Config::new().with_file_drop_handler(|_w, e| {
2024-01-15 21:06:05 +00:00
println!("{e:?}");
true
}))
2024-01-18 20:32:01 +00:00
.launch(app)
2022-01-10 17:57:39 +00:00
}
fn app() -> Element {
2024-01-16 19:18:46 +00:00
rsx!(
div { h1 { "drag a file here and check your console" } }
2024-01-14 05:12:21 +00:00
)
2022-01-10 17:57:39 +00:00
}