Expand description
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.
Modules§
Structs§
- Async
Event Receiver - This object which receives an event from UI thread.
- Async
Inner Window - Represents an inner window of async version.
- Async
Window - Represents a window of async version.
- Borderless
Style - Represents a borderless window style.
- Builder
- Event
Receiver - This object which receives an event from UI thread.
- File
Dialog Options - Represents options of dialogs.
- File
Open Dialog - A dialog for specifying a file (or files) to open.
- File
Save Dialog - A dialog for specifying a file to save.
- Filter
Spec - For specifying an extension in dialogs.
- Inner
Window - Represents an inner window.
- Inner
Window Builder - Builds a inner window.
- KeyCode
- Menu
- Represents a vertical menu.
- MenuBar
- Represents a horizontal menu.
- Menu
BarItem - Represents a item for MenuBar.
- Menu
Handle - Represents a menu handle. MenuHandle can compare with a MenuBar and a Menu.
- Mouse
Buttons - Mouse
State - Mouse
State Virtual Keys - Notify
Icon - Position
- Rect
- Scan
Code - Size
- UiThread
- Represents UI Thread.
- Window
- Represents a window.
- Window
Builder - Builds a window.
- Window
Handle - Window
Style - Represents a window style.
Enums§
- Async
Window Kind - Represents
AsyncWindoworAsyncInnerWindow - Color
Mode - Represents a color mode.
- Color
Mode State - Represents a color mode state.
- Cursor
- Represents mouse cursors.
- Error
- The error type for Windows apis, std::io and an UI thread state.
- Event
- Represents a event.
- Icon
- Represents icons.
- KeyState
- Menu
Item - Represents a item for a Menu.
- Mouse
Button - Mouse
Wheel Axis - NcHit
Test Value - Values which can return from WM_NCHITTEST
- Notify
Icon Event - Resizing
Edge - An moving edge of window when resizing.
- TryRecv
Error - The error type for
EventReceiverandAsyncEventReceiver. - Virtual
Key - Window
Kind - Represents
WindoworInnerWindow
Constants§
- DEFAULT_
DPI - WHEEL_
DELTA - This value is a multiple of wheel value.
Traits§
- Collision
- Filter
Specs - For specifying extensions in dialogs.
- IsReceiver
EventReceiveandAsyncEventReceiverare implement this trait.- IsWindow
WindowandAsyncWindoware implement this trait.- Style
- Window styles are implement this trait.
- ToLogical
- ToPhysical
Functions§
- client_
to_ screen - contains
- get_
cursor_ pos - is_
crossing - is_
system_ dark_ mode - Check the dark mode in Windows.
- screen_
to_ client - shutdown
- Shutdown UI thread.
Type Aliases§
- Async
Recv Event - The async version type of receiving event from UI thread.
- Button
State - Logical
Position - Logical
Rect - Logical
Size - Physical
Position - Physical
Rect - Physical
Size - Recv
Event - The type of receiving event from UI thread.
- Result
- This type is
Result<T, wiard::Error>. - Screen
Position - TryRecv
Result - This type is
Result<T, wiard::TryRecvError>.