Runtime
run
Run a view in a window on Wayland, rendered by Impeller, until the window closes.
FN
crownui::runuse crownui::prelude::*;
fn main() -> Result<(), crownui::RunError> {
crownui::run(
component(|cx| text("Hello")),
AppConfig::new("Hello").size(480, 320),
)
}pub fn run(root: impl View, config: AppConfig) -> Result<(), RunError>run opens one window, lays it out with taffy and renders it with Impeller until the window closes.
Parameters
rootimpl Viewrequired
The view to show. Usually a component(|cx| ..) whose closure builds the UI once.
configAppConfigrequired
Window options, built from AppConfig::new(title).
Returns
Ok(())()
The window was closed.
ErrRunError
The graphics backend, the platform or a thread failed to start.
Several windows
crownui::run_windows(vec![..]) takes (AnyView, AppConfig) pairs and runs until the last window
closes. Each window has its own UI, so signals are not shared between them.