Trait rstk::widget::TkWidget

source ·
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§

source

fn id(&self) -> &str

Returns the widget’s id reference - used within tk

Provided Methods§

source

fn bind(&self, pattern: &str, command: impl Fn(TkEvent) + Send + 'static)

Binds a command to this widget to call on given event pattern

source

fn cget(&self, option: &str) -> String

Retrieve the value of a configuration option as a string.

  • option - the option to read
source

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 change
  • value - the value to change it to
source

fn destroy(&self)

Destroys a widget and its children.

source

fn winfo(&self, option: &str) -> String

winfo retrieves information about widget.

source

fn focus(&self)

Makes this widget the focus window (e.g. for key presses)

source

fn position_x(&self) -> u64

Returns the widget x position in pixels, within its parent.

source

fn position_y(&self) -> u64

Returns the widget y position in pixels, within its parent.

source

fn widget_height(&self) -> u64

Returns the widget height in pixels.

source

fn widget_width(&self) -> u64

Returns the widget width in pixels.

source

fn mouse_position(&self) -> (i64, i64)

Returns the position of the mouse on screen of widget as (x,y).

source

fn mouse_x(&self) -> i64

Gives the x position of the mouse on screen of widget.

source

fn mouse_y(&self) -> i64

Gives the y position of the mouse on screen of widget.

source

fn screen_height(&self) -> u64

Height of screen of widget in pixels.

source

fn screen_height_mm(&self) -> u64

Height of screen of widget in millimetres.

source

fn screen_width(&self) -> u64

Width of screen of widget in pixels.

source

fn screen_width_mm(&self) -> u64

Width of screen of widget in millimetres.

source

fn lower(&self)

Lowers the widget in stacking order.

source

fn raise(&self)

Raises the widget in stacking order.

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementors§