Function create_window_before_run

Source
pub fn create_window_before_run(
    event_loop: &EventLoop<()>,
    options: WindowOptions,
) -> Result<Window, OsError>
Expand description

For tests / tools that need a window before run_app.

Uses deprecated [EventLoop::create_window]; centralized here to limit warnings and keep a single framework layer. Unlike create_window, this path does not constrain a requested initial size to the current monitor.

§Errors

Returns winit’s platform error when native creation fails.

§Examples

use ailloli_ui_winit::{create_window_before_run, WindowOptions};
use winit::event_loop::EventLoop;
fn open(loop_: &EventLoop<()>) -> Result<winit::window::Window, winit::error::OsError> {
    create_window_before_run(loop_, WindowOptions::default())
}