[][src]Crate cursive_multiplex

cursive view multiplexer

This crate provides a view for the cursive tui crate. It provides an easier way to display nesting view structures as for example in tmux in cursive. All that has to be done is to insert the view into cursive and later to operate on the reference of it, to add, remove, switch views.

Similar to tmux the user is able to resize, and switch between the current views, given they are focusable.

Usage example

extern crate cursive;
extern crate cursive_multiplex;

use cursive_multiplex::{MuxBuilder, Mux};
use cursive::views::TextView;
use cursive::Cursive;

fn main() {
    let (mut mux, node1) = MuxBuilder::new().build(TextView::new("Hello World".to_string()));
    let mut siv = Cursive::default();
    mux.add_horizontal_id(TextView::new("Hello from me too!".to_string()), node1);
    siv.add_fullscreen_layer(mux);

    // When your finished setting up
    // siv.run();
}

Structs

Mux

View holding information and managing multiplexer.

MuxBuilder

Builder for the multiplexer, default values for actions are set, but can be modified by calling the corresponding methods of the builder instance.

Enums

Path

Path is a recursive enum made to be able to identify a pane by it's actual location in the multiplexer. An upper Pane on the left side for example would have the path Path::LeftOrUp(Box::new(Some(Path::LeftOrUp(Box::new(None))))).

Type Definitions

Id

Identifier for views in binary tree of mux, typically returned after adding a new view to the multiplexer.