Trait rstk::grid::TkGridLayout

source ·
pub trait TkGridLayout: TkWidget {
    // Provided methods
    fn grid(&self) -> GridLayout { ... }
    fn grid_configure(&self, option: &str, value: &str) { ... }
    fn grid_forget(&self) { ... }
}
Expand description

Common functions for widgets that can be arranged using GridLayouts

Provided Methods§

source

fn grid(&self) -> GridLayout

Creates a GridLayout instance for placing this widget within its parent.

Examples found in repository?
examples/hello-world-2.rs (line 7)
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 9)
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");
    }
}
source

fn grid_configure(&self, option: &str, value: &str)

Sets properties for widget layout directly through Tk: see Tk manual for options.

e.g. to set the “padx” value to “5” on a label:

label.grid_configure("padx", "5");
source

fn grid_forget(&self)

Removes this widget from layout.

Object Safety§

This trait is not object safe.

Implementors§