Struct cursive::views::LinearLayout [] [src]

pub struct LinearLayout {
    // some fields omitted
}

Arranges its children linearly according to its orientation.

Methods

impl LinearLayout
[src]

fn new(orientation: Orientation) -> Self

Creates a new layout with the given orientation.

fn weight(self, weight: usize) -> Self

Modifies the weight of the last child added.

It is an error to call this before adding a child (and it will panic).

fn child<V: View + 'static>(self, view: V) -> Self

Adds a child to the layout.

Chainable variant.

fn add_child<V: View + 'static>(&mut self, view: V)

Adds a child to the layout.

fn vertical() -> Self

Creates a new vertical layout.

fn horizontal() -> Self

Creates a new horizontal layout.

Trait Implementations

impl View for LinearLayout
[src]

fn draw(&self, printer: &Printer)

Draws the view with the given printer (includes bounds) and focus.

fn needs_relayout(&self) -> bool

Returns true if the view content changed since last layout phase. Read more

fn layout(&mut self, size: Vec2)

Called once the size for this view has been decided, Read more

fn get_min_size(&mut self, req: Vec2) -> Vec2

Returns the minimum size the view requires with the given restrictions. Read more

fn take_focus(&mut self, source: Direction) -> bool

This view is offered focus. Will it take it? Read more

fn on_event(&mut self, event: Event) -> EventResult

Called when a key was pressed. Default implementation just ignores it.

fn find(&mut self, selector: &Selector) -> Option<&mut Any>

Finds the view pointed to by the given path. Read more