Function freya::launch::launch_cfg

source ·
pub fn launch_cfg<T: 'static + Clone>(
    app: fn() -> Element,
    config: LaunchConfig<'_, T>
)
Expand description

Launch a new window with a custom config. You can use a builder if you wish.

  • Width
  • Height
  • Decorations
  • Transparency
  • Window title
  • Window background color

§Example


fn main() {
    launch_cfg(
        app,
        LaunchConfig::<()>::new()
            .with_size(500.0, 400.0)
            .with_decorations(true)
            .with_transparency(false)
            .with_title("Freya App")
            .with_background("rgb(150, 100, 200)")
    );
}

fn app() -> Element {
   rsx!(
        rect {
            width: "100%",
            height: "100%",
            label {
                "Hello World!"
            }
        }
    )
}