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]
fn new(
bar: &Bar,
content: &str,
font: Option<&FontDescription>,
color: Option<Color>
) -> Result<Self>
[src]
bar: &Bar,
content: &str,
font: Option<&FontDescription>,
color: Option<Color>
) -> Result<Self>
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();