From 462ba3b2c81b630f698f9d927b6f82e500943ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sat, 18 Apr 2020 21:29:14 +0200 Subject: [PATCH] Implement and expose `Element::on_event` --- native/src/element.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/native/src/element.rs b/native/src/element.rs index 4e7c7fc6..f29580fc 100644 --- a/native/src/element.rs +++ b/native/src/element.rs @@ -227,6 +227,28 @@ where self.widget.layout(renderer, limits) } + /// Processes a runtime [`Event`]. + /// + /// [`Event`]: enum.Event.html + pub fn on_event( + &mut self, + event: Event, + layout: Layout<'_>, + cursor_position: Point, + messages: &mut Vec, + renderer: &Renderer, + clipboard: Option<&dyn Clipboard>, + ) { + self.widget.on_event( + event, + layout, + cursor_position, + messages, + renderer, + clipboard, + ); + } + /// Draws the [`Element`] and its children using the given [`Layout`]. /// /// [`Element`]: struct.Element.html