Function freya::launch::launch_cfg

source ·
pub fn launch_cfg<T: 'static + Clone + Send>(
    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::<()>::builder()
            .with_width(500.0)
            .with_height(400.0)
            .with_decorations(true)
            .with_transparency(false)
            .with_title("Freya App")
            .with_background("rgb(150, 100, 200")
            .build()
    );
}

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