#[tokio::main] async fn main() { let mut rx = witas::EventReceiver::new(); let _window = witas::Window::builder() .title("witas dialog") .inner_size(witas::LogicalSize::new(640, 480)) .set_receiver(&rx) .await .unwrap(); loop { let (event, _) = rx.recv().await; match event { witas::Event::KeyInput(input) if input.key_state == witas::KeyState::Pressed => { match input.key_code.vkey { witas::VirtualKey::O => { let path = witas::FileOpenDialog::new().await.unwrap(); println!("Open: {:?}", path); } witas::VirtualKey::M => { let paths = witas::FileOpenDialog::new() .allow_multi_select() .await .unwrap(); println!("Open(Multi): {:?}", paths); } witas::VirtualKey::S => { let path = witas::FileSaveDialog::new().await.unwrap(); println!("Save: {:?}", path); } _ => {} } } witas::Event::Closed => break, _ => {} } } }