Skip to main content

create_window

Function create_window 

Source
pub fn create_window(shell: &NativeShell) -> Result<ShellWindow, ShellError>
Expand description

Create a native window from the given NativeShell configuration.

The actual backend used depends on the backend field:

§Errors

Returns a ShellError if the window could not be created (e.g. the requested backend is not available on the current platform).

§Examples

use cvkg_cli::native_shell::{NativeShell, ShellBackend, create_window};
let shell = NativeShell::new("Test").backend(ShellBackend::Headless);
let window = create_window(&shell).expect("Failed to create window");
assert_eq!(window.title, "Test");