[][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::Mux;
use cursive::views::TextView;
use cursive::Cursive;

fn main() {
    let (mut mux, node1) = Mux::new(TextView::new("Hello World".to_string()));
    let mut siv = Cursive::default();
    mux.add_right_of(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.

Path

Path used to get the id of a specific pane in the mux. self can be directed by calling .up(), .down(), .left() and .right() on the instance. To get the final id of a pane .build().

Enums

AddViewError
RemoveViewError
SwitchError

Type Definitions

Id

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