#window #windows #async-version

wiard

Window handling library for Windows in Rust

18 releases

new 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

#279 in GUI

Download history 85/week @ 2024-07-01 41/week @ 2024-07-08 97/week @ 2024-07-22 26/week @ 2024-07-29 196/week @ 2024-08-05 157/week @ 2024-08-12 182/week @ 2024-08-19 12/week @ 2024-09-16 30/week @ 2024-09-23 209/week @ 2024-09-30 155/week @ 2024-10-07 160/week @ 2024-10-14

554 downloads per month
Used in pnte

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