Struct tty_form::control::StaticText
source · pub struct StaticText { /* private fields */ }Expand description
Static, unfocusable, formatable display text. May be dependent on other form elements.
Examples
use tty_interface::Style;
use tty_form::{
step::CompoundStep,
control::{Control, StaticText},
};
let mut text = StaticText::new("Hello, world!");
text.set_style(Style::new().set_bold(true));
let mut step = CompoundStep::new();
text.add_to(&mut step);Implementations
sourceimpl StaticText
impl StaticText
sourcepub fn set_dependency(&mut self, id: DependencyId, action: Action)
pub fn set_dependency(&mut self, id: DependencyId, action: Action)
Sets a dependency on the specified ID, performing some action if it evaluates true.
Trait Implementations
sourceimpl Control for StaticText
impl Control for StaticText
sourcefn text(&self) -> (Segment, Option<u16>)
fn text(&self) -> (Segment, Option<u16>)
This control’s rendered contents and an optional offset for the cursor.
sourcefn drawer(&self) -> Option<DrawerContents>
fn drawer(&self) -> Option<DrawerContents>
This control’s drawer contents, if available.
sourcefn evaluation(&self) -> Option<(DependencyId, Evaluation)>
fn evaluation(&self) -> Option<(DependencyId, Evaluation)>
This control’s dependency evaluation which other controls may react to.
sourcefn dependency(&self) -> Option<(DependencyId, Action)>
fn dependency(&self) -> Option<(DependencyId, Action)>
This control’s dependency which it may react to.
sourcefn evaluate(&self, _evaluation: &Evaluation) -> bool
fn evaluate(&self, _evaluation: &Evaluation) -> bool
Perform an evaluation against this control’s current state.
sourcefn add_to(self, step: &mut CompoundStep)
fn add_to(self, step: &mut CompoundStep)
Finish configuration and add this control to the specified form step.
Auto Trait Implementations
impl RefUnwindSafe for StaticText
impl Send for StaticText
impl Sync for StaticText
impl Unpin for StaticText
impl UnwindSafe for StaticText
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more