Struct libera::all::NotcursesTextGrid
source · pub struct NotcursesTextGrid { /* private fields */ }
revela
only.Implementations§
source§impl NotcursesTextGrid
impl NotcursesTextGrid
sourcepub fn new(
nc: &mut NotcursesBackend,
zone: impl Into<Zone32>
) -> Result<NotcursesTextGrid, RevelaError>
pub fn new( nc: &mut NotcursesBackend, zone: impl Into<Zone32> ) -> Result<NotcursesTextGrid, RevelaError>
Creates a new standalone text grid.
sourcepub fn new_child(
&mut self,
zone: impl Into<Zone32>
) -> Result<NotcursesTextGrid, RevelaError>
pub fn new_child( &mut self, zone: impl Into<Zone32> ) -> Result<NotcursesTextGrid, RevelaError>
Creates a new text grid that has the current text grid as a parent.
sourcepub fn is_scrolling(&self) -> bool
pub fn is_scrolling(&self) -> bool
Returns true
if the text grid is set to scroll.
sourcepub fn set_scrolling(&mut self, scroll: bool) -> bool
pub fn set_scrolling(&mut self, scroll: bool) -> bool
Sets the text grid to scroll
, or not.
source§impl NotcursesTextGrid
impl NotcursesTextGrid
pub fn from_plane(plane: Plane) -> NotcursesTextGrid
pub fn into_inner(self) -> Plane
pub fn ref_inner(&self) -> &Plane
pub fn mut_inner(&mut self) -> &mut Plane
Trait Implementations§
source§impl Debug for NotcursesTextGrid
impl Debug for NotcursesTextGrid
source§impl TextGrid for NotcursesTextGrid
impl TextGrid for NotcursesTextGrid
source§fn cursor(&self) -> Position32
fn cursor(&self) -> Position32
Returns the current cursor position.
source§fn cursor_home(&mut self)
fn cursor_home(&mut self)
Moves the cursor to the home position (0, 0
).
source§fn cursor_to(
&mut self,
position: impl Into<Position32>
) -> Result<(), RevelaError>
fn cursor_to( &mut self, position: impl Into<Position32> ) -> Result<(), RevelaError>
Moves the cursor to the specified position.
Errors
If the coordinates exceed the inner plane’s dimensions. The cursor will remain unchanged in that case.
source§fn cursor_to_row(&mut self, row: i32) -> Result<(), RevelaError>
fn cursor_to_row(&mut self, row: i32) -> Result<(), RevelaError>
Moves the cursor to the specified row
.
Errors
If the row number exceed the inner plane’s rows. The cursor will remain unchanged in that case.
source§fn cursor_to_col(&mut self, col: i32) -> Result<(), RevelaError>
fn cursor_to_col(&mut self, col: i32) -> Result<(), RevelaError>
Moves the cursor to the specified col
umn.
Errors
If the row number exceed the inner plane’s columns. The cursor will remain unchanged in that case.
source§fn cursor_offset(
&mut self,
offset: impl Into<Position32>
) -> Result<(), RevelaError>
fn cursor_offset( &mut self, offset: impl Into<Position32> ) -> Result<(), RevelaError>
Moves the cursor
Errors
If the coordinates exceed the inner plane’s dimensions. The cursor will remain unchanged in that case.
source§fn print(&mut self, string: &str) -> Result<u32, RevelaError>
fn print(&mut self, string: &str) -> Result<u32, RevelaError>
Prints a string
to the current cursor position.
Errors
- if the position falls outside the plane’s area.
- if a glyph can’t fit in the current line, unless scrolling is enabled.
source§fn contents(&mut self) -> Result<String, RevelaError>
Available on crate feature alloc
only.
fn contents(&mut self) -> Result<String, RevelaError>
alloc
only.Returns a string with the full contents.
fn raster(&mut self) -> Result<(), RevelaError>
fn render(&mut self) -> Result<(), RevelaError>
source§impl Visual for NotcursesTextGrid
impl Visual for NotcursesTextGrid
fn zone(&self) -> Zone32
fn size(&self) -> Size32
fn position(&self) -> Position32
source§fn offset(&mut self, offset: impl Into<Position32>) -> Result<(), RevelaError>
fn offset(&mut self, offset: impl Into<Position32>) -> Result<(), RevelaError>
offset
relative to its current position.source§fn move_to(
&mut self,
position: impl Into<Position32>
) -> Result<(), RevelaError>
fn move_to( &mut self, position: impl Into<Position32> ) -> Result<(), RevelaError>
position
, relative to its parent.