pub struct Screen {
pub width: u16,
pub height: u16,
}
Expand description
The dimensions of the screen
Fields§
§width: u16
§height: u16
Implementations§
source§impl Screen
impl Screen
pub fn new(con: &AppContext) -> Result<Screen, ProgramError>
pub fn set_terminal_size(&mut self, w: u16, h: u16, con: &AppContext)
pub fn read_size(&mut self, con: &AppContext) -> Result<(), ProgramError>
sourcepub fn goto(self, w: &mut W, x: u16, y: u16) -> Result<(), ProgramError>
pub fn goto(self, w: &mut W, x: u16, y: u16) -> Result<(), ProgramError>
move the cursor to x,y
sourcepub fn clear_line(self, w: &mut W) -> Result<(), ProgramError>
pub fn clear_line(self, w: &mut W) -> Result<(), ProgramError>
clear from the cursor to the end of line
sourcepub fn clear_area_to_right(
self,
w: &mut W,
area: &Area
) -> Result<(), ProgramError>
pub fn clear_area_to_right( self, w: &mut W, area: &Area ) -> Result<(), ProgramError>
clear the area and everything to the right. Should be used with parcimony as it could lead to flickering.
sourcepub fn clear_bottom_right_char(
&self,
w: &mut W,
panel_skin: &PanelSkin
) -> Result<(), ProgramError>
pub fn clear_bottom_right_char( &self, w: &mut W, panel_skin: &PanelSkin ) -> Result<(), ProgramError>
just clears the char at the bottom right. (any redraw of this position makes the whole terminal flicker on some terminals like win/conemu, so we draw it only once at start of the app)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Screen
impl Send for Screen
impl Sync for Screen
impl Unpin for Screen
impl UnwindSafe for Screen
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more