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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.