2022-12-31 03:05:15 +00:00
|
|
|
use dioxus::prelude::*;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
dioxus_desktop::launch(app);
|
|
|
|
}
|
|
|
|
|
2024-01-14 04:51:37 +00:00
|
|
|
fn app() -> Element {
|
2024-01-14 05:12:21 +00:00
|
|
|
rsx! {
|
2022-12-31 03:05:15 +00:00
|
|
|
div {
|
|
|
|
button {
|
|
|
|
onclick: move |_| {
|
2023-01-01 02:00:23 +00:00
|
|
|
let dom = VirtualDom::new(popup);
|
2023-10-23 20:26:10 +00:00
|
|
|
dioxus_desktop::window().new_window(dom, Default::default());
|
2022-12-31 03:05:15 +00:00
|
|
|
},
|
|
|
|
"New Window"
|
|
|
|
}
|
|
|
|
}
|
2024-01-14 05:12:21 +00:00
|
|
|
}
|
2022-12-31 03:05:15 +00:00
|
|
|
}
|
|
|
|
|
2024-01-14 04:51:37 +00:00
|
|
|
fn popup() -> Element {
|
2024-01-14 05:12:21 +00:00
|
|
|
rsx! {
|
2022-12-31 03:05:15 +00:00
|
|
|
div { "This is a popup!" }
|
2024-01-14 05:12:21 +00:00
|
|
|
}
|
2022-12-31 03:05:15 +00:00
|
|
|
}
|