witas 0.11.2

An asynchronous window library in Rust for Windows
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[tokio::main]
async fn main() {
    let mut rx = witas::EventReceiver::new();
    let _window = witas::Window::builder()
        .title("witas icon")
        .inner_size(witas::LogicalSize::new(640, 480))
        .set_receiver(&rx)
        .icon(witas::Icon::from_path("examples/icon.ico"))
        .await
        .unwrap();
    loop {
        let (event, _) = rx.recv().await;
        if let witas::Event::Closed = event {
            break;
        }
    }
}