Creating an Application

The first step to building a GUI with vizia is to create an application. Creating a new application creates a main window and a context. Views declared within the closure passed to Application::new() are added to the context and rendered into the main window.

use vizia::prelude::*;

fn main() -> Result<(), ApplicationError> {
    Application::new(|cx|{
        // Content goes here
    })
    .run()   
}

Calling run() on the Application causes the program to enter the event loop and for the main window to display.

An empty vizia application main window