#[tokio::main] async fn main() { let mut rx = witas::EventReceiver::new(); let mut windows = vec![]; for i in 0..3 { let window = witas::Window::builder() .title(format!("window{i}")) .position((50 * (i + 1), 50 * (i + 1))) .inner_size(witas::LogicalSize::new(640, 480)) .set_receiver(&rx) .parent((i != 0).then(|| &windows[i as usize - 1])) .await .unwrap(); windows.push(window); } loop { let (event, window) = rx.recv().await; if let witas::Event::Closed = event { let i = windows.iter().position(|w| w == &window).unwrap(); println!("winodw{i} closed"); } if windows.iter().all(|w| w.is_closed()) { break; } } }