#[tokio::main] async fn main() { let mut rx = witas::EventReceiver::new(); let _window = witas::Window::builder() .title("witas close_request") .inner_size(witas::LogicalSize::new(640, 480)) .set_receiver(&rx) .auto_close(false) .await .unwrap(); loop { let (event, _) = rx.recv().await; match event { witas::Event::CloseRequest(w) => { println!("CloseRequest"); w.destroy(); } witas::Event::Closed => { println!("Closed"); break; } _ => {} } } }