pub trait EventContext<Message> {
// Required methods
fn invalidate_render(&mut self);
fn invalidate_layout(&mut self);
fn emit_message(&mut self, message: Message);
fn clipboard(&self) -> &dyn Clipboard;
fn clipboard_mut(&mut self) -> &mut dyn Clipboard;
fn cursor_position(&self) -> Position;
fn set_cursor_position(&mut self, value: Position);
fn keyboard_focus(&self) -> bool;
fn set_keyboard_focus(&mut self, value: bool);
fn mouse_focus(&self) -> bool;
fn set_mouse_focus(&mut self, value: bool);
}Required Methods§
Sourcefn invalidate_render(&mut self)
fn invalidate_render(&mut self)
Forces the widget to be rerendered.
Sourcefn invalidate_layout(&mut self)
fn invalidate_layout(&mut self)
Forces the widget’s layout to be recalculated and so the widget to be rerendered.
Sourcefn emit_message(&mut self, message: Message)
fn emit_message(&mut self, message: Message)
Emits the message for application to handle.
Sourcefn clipboard_mut(&mut self) -> &mut dyn Clipboard
fn clipboard_mut(&mut self) -> &mut dyn Clipboard
Returns mutable reference to the clipboard.
Sourcefn cursor_position(&self) -> Position
fn cursor_position(&self) -> Position
Gets position of the cursor in global cooridnates.
Sourcefn set_cursor_position(&mut self, value: Position)
fn set_cursor_position(&mut self, value: Position)
Sets position of the cursor in global coordinates.
There is only one cursor per terminal, but any widget in the tree can move it, so be careful.
Sourcefn keyboard_focus(&self) -> bool
fn keyboard_focus(&self) -> bool
Returns keyboard focus state of this widget.
When a widget has keyboard focus all key event routed to it.
Sourcefn set_keyboard_focus(&mut self, value: bool)
fn set_keyboard_focus(&mut self, value: bool)
Sets the keyboard focus.
Sourcefn mouse_focus(&self) -> bool
fn mouse_focus(&self) -> bool
Gets value indicating whether this widget captures mouse or not.
When widget has mouse focus all mouse events roted to it.
Sourcefn set_mouse_focus(&mut self, value: bool)
fn set_mouse_focus(&mut self, value: bool)
Sets the mouse focus.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".