pub struct Screen { /* private fields */ }Expand description
The panes on a screen, and where everything goes.
Implementations§
Source§impl Screen
impl Screen
Sourcepub fn new(rows: usize, columns: usize, side_panes: bool) -> Self
pub fn new(rows: usize, columns: usize, side_panes: bool) -> Self
A screen of the given size, with no panes.
Sourcepub fn create(
&mut self,
parent: Option<u32>,
placement: Placement,
spec: PaneSpec,
) -> Option<u32>
pub fn create( &mut self, parent: Option<u32>, placement: Placement, spec: PaneSpec, ) -> Option<u32>
Create a pane, or None if it cannot be.
Sourcepub fn write(&mut self, id: u32, text: &str)
pub fn write(&mut self, id: u32, text: &str)
Add text to a pane. A newline goes to the start of the next line.
Sourcepub fn go_to(&mut self, id: u32, row: usize, column: usize)
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.
Sourcepub fn set_size(&mut self, id: u32, size: i32, units: i32, advisory: bool)
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.
Sourcepub fn size_to_contents(&mut self, id: u32)
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.
Sourcepub fn set_screen_color(&mut self, id: u32, color: u32)
pub fn set_screen_color(&mut self, id: u32, color: u32)
Give a pane a background color.
Sourcepub fn screen_color(&self, id: u32) -> Option<u32>
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.
Sourcepub fn layout(&self, id: u32) -> Option<PaneLayout>
pub fn layout(&self, id: u32) -> Option<PaneLayout>
How a pane is placed, as the program asked.
Sourcepub fn set_side_panes(&mut self, side_panes: bool)
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.
Sourcepub fn set_status(&mut self, left: &str, right: &str)
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.
Sourcepub fn panes(&self) -> Vec<(u32, Rect)>
pub fn panes(&self) -> Vec<(u32, Rect)>
The panes on the screen, outermost first, with where each is.
Sourcepub fn rect(&self, id: u32) -> Option<Rect>
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.
Sourcepub fn view(&self, id: u32) -> Vec<String>
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.
Sourcepub fn take_layout_changed(&mut self) -> bool
pub fn take_layout_changed(&mut self) -> bool
Whether the layout has changed since this was last asked, and everything needs drawing again.
Sourcepub fn take_changed(&mut self) -> Vec<u32>
pub fn take_changed(&mut self) -> Vec<u32>
The panes whose text has changed since this was last asked.