Struct leechbar::Text [] [src]

pub struct Text { /* fields omitted */ }

A cached text.

This creates a text that is cached on the X server. Keeping this around instead of moving it will usually lead to a lower CPU consumption but slightly increase the memory usage of the X server.

Methods

impl Text
[src]

[src]

Create a new cached text.

This takes an optional font and color, if these are not set it will use the default font and color of the bar.

Errors

This returns an error when the content parameter is an empty string slice, or when an X.Org request failed.

Examples

use leechbar::{Text, BarBuilder};

let bar = BarBuilder::new().spawn().unwrap();
let text = Text::new(&bar, "Hello, World", None, None).unwrap();

Trait Implementations

impl Clone for Text
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more