use karsa::printer::Size; use karsa::renderloop::run; use karsa::widgets::tabs::{Tab, Tabs}; use karsa::widgets::text::Text; use karsa::widgets::widgetbox::WidgetBox; use std::io; fn main() -> io::Result<()> { let tab1_content = Text::builder() .with_content("Tab 1 content".to_string()) .build(); let tab2_content = Text::builder() .with_content("Tab 2 content".to_string()) .build(); let tabs = vec![ Tab { title: "Tab 1".to_string(), width: Size::Ratio(20), widget: Box::new(tab1_content), }, Tab { title: "Tab 2".to_string(), width: Size::Ratio(20), widget: Box::new(tab2_content), }, ]; let tabs = Tabs::new(tabs); let widgetbox = WidgetBox::new(tabs, Some(70), Some(7), Some("Title".to_string())); run(widgetbox, None)?; Ok(()) }