Crate cursive_tabs
source · [−]Expand description
This crate provides a tabbing view for gyscos/cursive views. It is build to be as simple as possible.
The behaviour is oriented to be similar to StackView
of cursive, but with the advantage of selectively displaying
views without needing to delete foremost one.
Example
All you need to do to create a new TabView
is:
let mut tabs = TabView::new();
You can then use the provided methods to modify the content of the TabView
Consuming and non-consuming are both provided.
Full Example
use cursive::{view::Nameable, views::{TextView, Dialog}};
use cursive_tabs::TabView;
let mut siv = cursive::default();
let mut tabs = TabView::new();
// That is all what is needed to display an empty TabView, but of course
// you can add your own tabs now and switch them around as you want!
tabs.add_tab(TextView::new("Our first view!").with_name("First"));
siv.add_layer(Dialog::around(tabs));
// When your done setting run cursive
// siv.run();
Structs
The TabPanel
is an ease of use wrapper around a TabView
and its TabBar
.
Additionally the TabBar in the Panel can be horizontally aligned, by default it is set to be left aligned.
Main struct which manages views