#window #windows #async-version

wiard

Window handling library for Windows in Rust

18 releases

0.3.1 Oct 25, 2024
0.2.3 Oct 11, 2024
0.1.9 Jul 27, 2024
0.1.5 Mar 4, 2024
0.1.1 Nov 26, 2023

#301 in GUI

Download history 5/week @ 2024-07-13 121/week @ 2024-07-27 165/week @ 2024-08-03 49/week @ 2024-08-10 313/week @ 2024-08-17 10/week @ 2024-08-24 12/week @ 2024-09-14 20/week @ 2024-09-21 197/week @ 2024-09-28 141/week @ 2024-10-05 182/week @ 2024-10-12 102/week @ 2024-10-19 42/week @ 2024-10-26

611 downloads per month
Used in 2 crates

MIT license

130KB
4K SLoC

wiard

Window handling library for Windows in Rust

Simple examples

sync version

fn main() {
    let mut event_rx = wiard::EventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .build()
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv() else {
            break;
        };
        println!("{event:?}");
    }
}

async version

#[tokio::main]
async fn main() {
    let mut event_rx = wiard::AsyncEventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .await
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv().await else {
            break;
        };
        println!("{event:?}");
    }
}

License

This library is licensed under the MIT license.


lib.rs:

Window handing library for Windows in Rust

Simple examples

sync version

fn main() {
    let mut event_rx = wiard::EventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .build()
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv() else {
            break;
        };
        println!("{event:?}");
    }
}

async version

#[tokio::main]
async fn main() {
    let mut event_rx = wiard::AsyncEventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .await
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv().await else {
            break;
        };
        println!("{event:?}");
    }
}

Note

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

Dependencies

~135MB
~2M SLoC