Skip to main content

run_with

Function run_with 

Source
pub fn run_with(config: RunConfig, f: impl FnMut(&mut Context)) -> Result<()>
Expand description

Run the TUI loop with custom configuration.

Like run, but accepts a RunConfig to control tick rate, mouse support, and theming.

ยงExample

use slt::{RunConfig, Theme};

fn main() -> std::io::Result<()> {
    slt::run_with(
        RunConfig { theme: Theme::light(), ..Default::default() },
        |ui| {
            ui.text("Light theme!");
        },
    )
}