Struct kiss_ui::text::TextBox
[−]
[src]
pub struct TextBox(_);
A widget that renders user-editable text.
Methods
impl TextBox
fn new() -> TextBox
Create a new, empty text box.
fn set_multiline(self, multiline: bool) -> Self
Set if the text box should accept and render newline characters.
If false
, it will only be slightly taller than a line of text in the current font.
If true
, the total dimensions will be set by set_visible_columns
and
set_visible_lines
. Text outside these bounds will be accessible with a scrollbar.
fn set_visible_columns(self, cols: u32) -> Self
Set the rendered width of the textbox in columns (character width + padding).
If the textbox is set as multiline, this will cause additional text beyond the maximum width to wrap. Otherwise, it can be scrolled only horizontally.
fn set_visible_lines(self, lines: u32) -> Self
Set the rendered height of the textbox in lines (character height + padding).
If the textbox is set as multiline, newline characters will push text following them to the next visible line. Line counts beyond these bounds will cause a scrollbar to be shown.
fn set_text(self, value: &str) -> Self
Set the text of this textbox.
Panics
If any WidgetStr
instances from self.get_text()
are still reachable.
fn get_text(&self) -> WidgetStr
Get the text value of this textbox.