Skip to main content

Screen

Struct Screen 

Source
pub struct Screen { /* private fields */ }
Expand description

The panes on a screen, and where everything goes.

Implementations§

Source§

impl Screen

Source

pub fn new(rows: usize, columns: usize, side_panes: bool) -> Self

A screen of the given size, with no panes.

Source

pub fn resize(&mut self, rows: usize, columns: usize)

The screen has a new size.

Source

pub fn size(&self) -> (usize, usize)

The screen’s size, as lines and columns.

Source

pub fn main(&self) -> Rect

What is left for the main window.

Source

pub fn create( &mut self, parent: Option<u32>, placement: Placement, spec: PaneSpec, ) -> Option<u32>

Create a pane, or None if it cannot be.

Source

pub fn delete(&mut self, id: u32)

Delete a pane. Its own panes stay, but are no longer shown.

Source

pub fn clear(&mut self, id: u32)

Remove a pane’s text.

Source

pub fn write(&mut self, id: u32, text: &str)

Add text to a pane. A newline goes to the start of the next line.

Source

pub fn go_to(&mut self, id: u32, row: usize, column: usize)

Move where the next character goes in a grid, counting from zero. Text panes have no positions, and ignore this.

Source

pub fn set_size(&mut self, id: u32, size: i32, units: i32, advisory: bool)

Change a pane’s size. An advisory size is only a guess for hosts that cannot size a pane to its contents, so it is ignored.

Source

pub fn size_to_contents(&mut self, id: u32)

Make a pane just big enough for what it holds, in the dimension it can be sized in.

Source

pub fn set_screen_color(&mut self, id: u32, color: u32)

Give a pane a background color.

Source

pub fn screen_color(&self, id: u32) -> Option<u32>

The background color a pane was given, if any. The old-style status line has the status line’s.

Source

pub fn info(&self, id: u32) -> Option<PaneInfo>

What a program can learn about a pane.

Source

pub fn layout(&self, id: u32) -> Option<PaneLayout>

How a pane is placed, as the program asked.

Source

pub fn set_side_panes(&mut self, side_panes: bool)

Whether a pane can be at the left or right of the main window: a display that can keep the main window’s text to part of its width says yes.

Source

pub fn set_status(&mut self, left: &str, right: &str)

Show the old-style status line, the program’s location at the left and its score at the right, in a line of its own at the top.

Source

pub fn status(&self) -> Option<u32>

The old-style status line, if there is one.

Source

pub fn panes(&self) -> Vec<(u32, Rect)>

The panes on the screen, outermost first, with where each is.

Source

pub fn rect(&self, id: u32) -> Option<Rect>

The area a pane shows its own text in: what is left once its own panes have taken their space.

Source

pub fn view(&self, id: u32) -> Vec<String>

What a pane shows, a line for each line of its area, each as wide as the area.

Source

pub fn take_layout_changed(&mut self) -> bool

Whether the layout has changed since this was last asked, and everything needs drawing again.

Source

pub fn take_changed(&mut self) -> Vec<u32>

The panes whose text has changed since this was last asked.

Trait Implementations§

Source§

impl Debug for Screen

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Screen

§

impl Freeze for Screen
where *const LeafNode<u32, Window> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(u32, Window)>>: Freeze, *const u8 is !null: Freeze, PhantomData<u32>: Freeze, *const LeafNode<u32, SetValZST> is !null: Freeze, PhantomData<Box<(u32, SetValZST)>>: Freeze,

§

impl Move for Screen

§

impl RefUnwindSafe for Screen

§

impl Send for Screen
where NodeRef<Owned, u32, Window, LeafOrInternal>: Send, BoxRaw<(u32, Window)>: Send, RawVecInner: Send, NodeRef<Owned, u32, SetValZST, LeafOrInternal>: Send, BoxRaw<(u32, SetValZST)>: Send,

§

impl Sync for Screen
where NodeRef<Owned, u32, Window, LeafOrInternal>: Sync, BoxRaw<(u32, Window)>: Sync, RawVecInner: Sync, NodeRef<Owned, u32, SetValZST, LeafOrInternal>: Sync, BoxRaw<(u32, SetValZST)>: Sync,

§

impl Unpin for Screen
where *const LeafNode<u32, Window> is !null: Unpin, Box<(u32, Window)>: Unpin, *const u8 is !null: Unpin, *const LeafNode<u32, SetValZST> is !null: Unpin, Box<(u32, SetValZST)>: Unpin,

§

impl UnsafeUnpin for Screen
where *const LeafNode<u32, Window> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(u32, Window)>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u32>: UnsafeUnpin, *const LeafNode<u32, SetValZST> is !null: UnsafeUnpin, PhantomData<Box<(u32, SetValZST)>>: UnsafeUnpin,

§

impl UnwindSafe for Screen
where BTreeMap<u32, Window>: UnwindSafe, RawVecInner: UnwindSafe, BTreeMap<u32, SetValZST>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.