Get App Handle in on_window_event in WebviewWindow #13161
-
Hello, I am creating the window with Here is the how I am creating the window.
Things I've tried: Any help in getting the handle would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can get an AppHandle outside of the event handler and move it inside let handle = app.app_handle().clone();
tauri::WebviewWindowBuilder::from_config(app, config).unwrap().build().unwrap().on_window_event(move |event| match event {
WindowEvent::Destroyed => {
handle.do_something()
}
_ => {}
}); |
Beta Was this translation helpful? Give feedback.
You can get an AppHandle outside of the event handler and move it inside