Function freya::launch::launch_cfg

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

Launch a new Window with custom config.

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

Example

launch_cfg(
    app,
    WindowConfig::<()>::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(cx: Scope) -> Element {
   render!(
        rect {
            width: "100%",
            height: "100%",
            label {
                "Hello World!"
            }
        }
    )
}