Trait xplm::window::WindowDelegate
source · pub trait WindowDelegate: 'static {
// Required method
fn draw(&mut self, window: &Window);
// Provided methods
fn keyboard_event(&mut self, _window: &Window, _event: KeyEvent) { ... }
fn mouse_event(&mut self, _window: &Window, _event: MouseEvent) -> bool { ... }
fn scroll_event(&mut self, _window: &Window, _event: ScrollEvent) -> bool { ... }
fn cursor(&mut self, _window: &Window, _position: Point<i32>) -> Cursor { ... }
}
Expand description
Trait for things that can define the behavior of a window
Required Methods§
Provided Methods§
sourcefn keyboard_event(&mut self, _window: &Window, _event: KeyEvent)
fn keyboard_event(&mut self, _window: &Window, _event: KeyEvent)
Handles a keyboard event
The default implementation does nothing
sourcefn mouse_event(&mut self, _window: &Window, _event: MouseEvent) -> bool
fn mouse_event(&mut self, _window: &Window, _event: MouseEvent) -> bool
Handles a mouse event
Return false to consume the event or true to propagate it.
The default implementation does nothing and allows the event to propagate.
sourcefn scroll_event(&mut self, _window: &Window, _event: ScrollEvent) -> bool
fn scroll_event(&mut self, _window: &Window, _event: ScrollEvent) -> bool
Handles a scroll event
Return false to consume the event or true to propagate it.
The default implementation does nothing and allows the event to propagate.