Function rstk::label::make_label

source ·
pub fn make_label(parent: &impl TkWidget) -> TkLabel
Expand description

Creates an instance of a label widget in given parent.

Examples found in repository?
examples/hello-world-2.rs (line 4)
3
4
5
6
7
8
fn setup(root: &impl rstk::TkWidget) {
    let hello = rstk::make_label(root);
    hello.text("Hello from Rust/Tk");

    hello.grid().layout();
}
More examples
Hide additional examples
examples/hello-world.rs (line 6)
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");
    }
}