Struct cursive::views::TextView [] [src]

pub struct TextView { /* fields omitted */ }

A simple view showing a fixed text.

Examples

let mut siv = Cursive::new();

siv.add_layer(TextView::new("Hello world!"));

Methods

impl TextView
[src]

[src]

Creates a new TextView with the given content.

[src]

Creates a new TextView using the given Arc<Mutex<String>>.

If you kept a clone of the given content, you'll be able to update it remotely.

Examples

let mut content = TextContent::new("content");
let view = TextView::new_with_content(content.clone());

// Later, possibly in a different thread
content.set_content("new content");
assert!(content.get_content().source().contains("new"));

[src]

Creates a new empty TextView.

[src]

Enable or disable the view's scrolling capabilities.

When disabled, the view will never attempt to scroll (and will always ask for the full height).

[src]

Enable or disable the view's scrolling capabilities.

When disabled, the view will never attempt to scroll (and will always ask for the full height).

Chainable variant.

[src]

Sets the effect for the entire content.

[src]

Sets the effect for the entire content.

Chainable variant.

[src]

Sets the horizontal alignment for this view.

[src]

Sets the vertical alignment for this view.

[src]

Sets the alignment for this view.

[src]

Center the text horizontally and vertically inside the view.

[src]

Replace the text in this view.

Chainable variant.

[src]

Replace the text in this view.

[src]

Append content to the end of a TextView.

[src]

Returns the current text in this view.

[src]

Returns a shared reference to the content, allowing content mutation.

[src]

Defines the way scrolling is adjusted on content or size change.

The scroll strategy defines how the scrolling position is adjusted when the size of the view or the content change.

It is reset to ScrollStrategy::KeepRow whenever the user scrolls manually.

[src]

Defines the way scrolling is adjusted on content or size change.

Chainable variant.

[src]

Scroll up by n lines.

[src]

Scroll down by n lines.

[src]

Scroll to the bottom of the content.

[src]

Scroll to the top of the view.

Trait Implementations

impl View for TextView
[src]

[src]

Draws the view with the given printer (includes bounds) and focus.

[src]

Called when a key was pressed. Read more

[src]

Returns true if the view content changed since last layout phase. Read more

[src]

Returns the minimum size the view requires with the given restrictions. Read more

[src]

This view is offered focus. Will it take it? Read more

[src]

Called once the size for this view has been decided, Read more

[src]

Runs a closure on the view identified by the given selector. Read more

[src]

Moves the focus to the view identified by the given selector. Read more

Auto Trait Implementations

impl Send for TextView

impl Sync for TextView