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

Create a new static text control with the specified content.

Set the text for this control.

Set the optional style for this control.

Sets a dependency on the specified ID, performing some action if it evaluates true.

Trait Implementations

Whether this control is a focusable input.
Updates the control’s state from the given input event.
This control’s descriptive help text, if available.
This control’s rendered contents and an optional offset for the cursor.
This control’s drawer contents, if available.
This control’s dependency evaluation which other controls may react to.
This control’s dependency which it may react to.
Perform an evaluation against this control’s current state.
Finish configuration and add this control to the specified form step.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.