소스 검색

add to example

Benedikt Terhechte 2 년 전
부모
커밋
44025db5b0
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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 {