Struct cursive::view::EditView
[−]
[src]
pub struct EditView {
// some fields omitted
}Input box where the user can enter and edit text.
Methods
impl EditView[src]
fn new() -> Self
Creates a new, empty edit view.
fn set_content(&mut self, content: &str)
Replace the entire content of the view with the given one.
fn get_content(&self) -> &str
Get the current text.
fn content(self, content: &str) -> Self
Sets the current content to the given value.
Convenient chainable method.
fn min_length(self, min_length: usize) -> Self
Sets the minimum length for this view. (This applies to the layout, not the content.)
fn with_id(self, label: &str) -> IdView<Self>
Wraps this view into an IdView with the given id.
Trait Implementations
impl Default for EditView[src]
impl View for EditView[src]
fn draw(&mut self, printer: &Printer)
Draws the view with the given printer (includes bounds) and focus.
fn layout(&mut self, size: Vec2)
Called once the size for this view has been decided, so it can propagate the information to its children. Read more
fn get_min_size(&mut self, _: Vec2) -> Vec2
Returns the minimum size the view requires with the given restrictions.
fn take_focus(&mut self) -> bool
This view is offered focus. Will it take it?
fn on_event(&mut self, event: Event) -> EventResult
Called when a key was pressed. Default implementation just ignores it.
fn find(&mut self, &Selector) -> Option<&mut Any>
Finds the view pointed to by the given path. Returns None if the path doesn't lead to a view. Read more