#async #window #tokio #windows #rx #title

witas

An asynchronous window library in Rust for Windows

23 releases (10 breaking)

0.11.2 Oct 10, 2023
0.11.0 Aug 28, 2023
0.10.0 Jul 27, 2023
0.6.2 Mar 23, 2023
0.2.0 Nov 23, 2022

#678 in GUI

Download history 7/week @ 2024-09-18 40/week @ 2024-09-25 2/week @ 2024-10-02

104 downloads per month
Used in mltg

MIT license

155KB
4.5K SLoC

witas

wita at crates.io wita at docs.rs

An asynchronous window library in Rust for Windows

The simple example

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

Licensed under MIT License

Copylight (c) 2022 LNSEAB


lib.rs:

An asynchronous window library in Rust for Windows

Example

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

Note

witas use WM_APP. Don't post directly WM_APP to witas's UI thread.

Dependencies

~135MB
~2M SLoC