Trait rstk::widget::TkLabelOptions
source · pub trait TkLabelOptions: TkWidget {
// Provided methods
fn compound(&self, value: Compound) { ... }
fn font(&self, definition: &TkFont) { ... }
fn foreground(&self, colour: &str) { ... }
fn image(&self, image: &TkImage) { ... }
fn padding(&self, values: &[u64]) { ... }
fn text(&self, value: &str) { ... }
fn underline(&self, index: u64) { ... }
fn width(&self, value: i64) { ... }
}
Expand description
Provided Methods§
sourcefn foreground(&self, colour: &str)
fn foreground(&self, colour: &str)
Sets the foreground (text) colour.
sourcefn padding(&self, values: &[u64])
fn padding(&self, values: &[u64])
Sets space around the widget. Takes an array of up to four values, specifying the number of pixels on the different sides:
- [all]
- [left-right top-bottom]
- [left top-bottom right]
- [left top right bottom]
sourcefn text(&self, value: &str)
fn text(&self, value: &str)
Sets the text label for the widget.
Examples found in repository?
More examples
examples/hello-world.rs (line 7)
3 4 5 6 7 8 9 10 11 12 13 14 15
fn main() {
if let Ok(root) = rstk::start_wish() {
let hello = rstk::make_label(&root);
hello.text("Hello from Rust/Tk");
hello.grid().row(0).column(0).layout();
rstk::mainloop();
} else {
println!("Failed to start wish program");
}
}
Object Safety§
This trait is not object safe.