Crates.io | js_resized_event_channel |
lib.rs | js_resized_event_channel |
version | |
source | src |
created_at | 2024-10-12 03:50:18.541742 |
updated_at | 2024-12-08 07:15:43.722164 |
description | js resized event channel (only supports full size window) |
homepage | |
repository | https://github.com/Bruce0203/js_resized_event_channel |
max_upload_size | |
id | 1406105 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
use js_resized_event_channel::{JsResizeEventChannel, ResizeEventChannel};
use winit::{dpi::PhysicalSize, event_loop::EventLoop, window::WindowAttributes};
fn main() {
let event_loop: EventLoop<()> = EventLoop::new().unwrap();
let window = event_loop
.create_window(WindowAttributes::default())
.unwrap();
let resize_event_channel = JsResizeEventChannel::init(&window);
event_loop
.run(|event, event_loop| {
if resize_event_channel.try_recv_resized_event() {
let _ = window.request_inner_size(resize_event_channel.size());
}
})
.unwrap();
}