Explorar o código

add to example

Benedikt Terhechte %!s(int64=2) %!d(string=hai) anos
pai
achega
44025db5b0
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      examples/window_focus.rs

+ 4 - 1
examples/window_focus.rs

@@ -2,9 +2,12 @@ use dioxus::prelude::*;
 use dioxus_desktop::tao::event::WindowEvent;
 use dioxus_desktop::use_wry_event_handler;
 use dioxus_desktop::wry::application::event::Event as WryEvent;
+use dioxus_desktop::{Config, WindowCloseBehaviour};
 
 fn main() {
-    dioxus_desktop::launch(app);
+    let cfg = Config::new().with_close_behaviour(WindowCloseBehaviour::CloseWindow);
+
+    dioxus_desktop::launch_cfg(app, cfg);
 }
 
 fn app(cx: Scope) -> Element {