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
554 downloads per month
Used in pnte
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