Skip to main content

run

Function run 

Source
pub fn run(f: impl FnMut(&mut Context)) -> Result<()>
Expand description

Run the TUI loop with default configuration.

Enters alternate screen mode, runs f each frame, and exits cleanly on Ctrl+C or when Context::quit is called.

ยงExample

fn main() -> std::io::Result<()> {
    slt::run(|ui| {
        ui.text("Press Ctrl+C to exit");
    })
}