Merge pull request #305 from hecrj/element-on-event

Implement and expose `Element::on_event`
This commit is contained in:
Héctor Ramón 2020-04-19 15:28:53 +02:00 committed by GitHub
commit edd01159e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -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<Message>,
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