pub trait TkWidget {
Show 22 methods
// Required method
fn id(&self) -> &str;
// Provided methods
fn bind(&self, pattern: &str, command: impl Fn(TkEvent) + Send + 'static) { ... }
fn cget(&self, option: &str) -> String { ... }
fn configure(&self, option: &str, value: &str) { ... }
fn destroy(&self) { ... }
fn winfo(&self, option: &str) -> String { ... }
fn focus(&self) { ... }
fn position_x(&self) -> u64 { ... }
fn position_y(&self) -> u64 { ... }
fn widget_height(&self) -> u64 { ... }
fn widget_width(&self) -> u64 { ... }
fn mouse_position(&self) -> (i64, i64) { ... }
fn mouse_x(&self) -> i64 { ... }
fn mouse_y(&self) -> i64 { ... }
fn screen_height(&self) -> u64 { ... }
fn screen_height_mm(&self) -> u64 { ... }
fn screen_width(&self) -> u64 { ... }
fn screen_width_mm(&self) -> u64 { ... }
fn lower(&self) { ... }
fn raise(&self) { ... }
fn grid_configure_column(&self, index: u64, option: &str, value: &str) { ... }
fn grid_configure_row(&self, index: u64, option: &str, value: &str) { ... }
}
Expand description
Common trait for container widgets. Child widgets should implement the id
method. The remaining methods are standard Tk methods and convenient,
type-safe versions of them.
Required Methods§
Provided Methods§
sourcefn bind(&self, pattern: &str, command: impl Fn(TkEvent) + Send + 'static)
fn bind(&self, pattern: &str, command: impl Fn(TkEvent) + Send + 'static)
Binds a command to this widget to call on given event pattern
sourcefn cget(&self, option: &str) -> String
fn cget(&self, option: &str) -> String
Retrieve the value of a configuration option as a string.
option
- the option to read
sourcefn configure(&self, option: &str, value: &str)
fn configure(&self, option: &str, value: &str)
Used to change properties of a widget. This function can be used to directly configure the widget using an option-value string pair:
option
- the option to changevalue
- the value to change it to
sourcefn position_x(&self) -> u64
fn position_x(&self) -> u64
Returns the widget x position in pixels, within its parent.
sourcefn position_y(&self) -> u64
fn position_y(&self) -> u64
Returns the widget y position in pixels, within its parent.
sourcefn widget_height(&self) -> u64
fn widget_height(&self) -> u64
Returns the widget height in pixels.
sourcefn widget_width(&self) -> u64
fn widget_width(&self) -> u64
Returns the widget width in pixels.
sourcefn mouse_position(&self) -> (i64, i64)
fn mouse_position(&self) -> (i64, i64)
Returns the position of the mouse on screen of widget as (x,y).
sourcefn screen_height(&self) -> u64
fn screen_height(&self) -> u64
Height of screen of widget in pixels.
sourcefn screen_height_mm(&self) -> u64
fn screen_height_mm(&self) -> u64
Height of screen of widget in millimetres.
sourcefn screen_width(&self) -> u64
fn screen_width(&self) -> u64
Width of screen of widget in pixels.
sourcefn screen_width_mm(&self) -> u64
fn screen_width_mm(&self) -> u64
Width of screen of widget in millimetres.
sourcefn grid_configure_column(&self, index: u64, option: &str, value: &str)
fn grid_configure_column(&self, index: u64, option: &str, value: &str)
Sets property for a given column of the grid layout contained within this widget.
sourcefn grid_configure_row(&self, index: u64, option: &str, value: &str)
fn grid_configure_row(&self, index: u64, option: &str, value: &str)
Sets property for a given row of the grid layout contained within this widget.