| Crates.io | winit_app |
| lib.rs | winit_app |
| version | 0.31.2 |
| created_at | 2026-01-06 15:57:05.807999+00 |
| updated_at | 2026-01-20 13:47:16.156719+00 |
| description | A starter package to get started with winit windowing library |
| homepage | https://opal-ui.github.io/winit-app-rs/ |
| repository | https://github.com/opal-ui/winit-app-rs |
| max_upload_size | |
| id | 2026148 |
| size | 54,739 |
[dependencies]
winit_app = "0.31.2"
This Rust library winit_app represents the code to get started with winit Rust windowing library.
(To see more details about winit see here at - https://github.com/rust-windowing/winit )
This project can be used as a start quick launching pad based on the winit library.
use winit::{event::WindowEvent, window::WindowAttributes};
use winit_app::{AppWindowEvent, Application};
fn launch_app() -> Result<(), Box<dyn std::error::Error>> {
let winit_app = Application::new();
winit_app.run(
WindowAttributes::default().with_title("Sample"),
|app_window_event| match app_window_event {
AppWindowEvent::NewWindow(_window) => {
// TODO: Do something with this window
}
AppWindowEvent::OnWindowEvent(event, event_loop) => match event {
WindowEvent::CloseRequested => {
// Just a default handler to exit the event_loop when window is being closed
event_loop.exit();
}
_ => {
// Handle all other window events
}
},
},
)?;
Ok(())
}