Return true in the Window::on_event callback if event was handled

This commit is contained in:
Antonio Scandurra 2022-06-17 17:09:16 +02:00
parent ae2273b40a
commit 607903eed5
5 changed files with 15 additions and 9 deletions

View file

@ -90,7 +90,7 @@ pub trait Dispatcher: Send + Sync {
pub trait Window: WindowContext {
fn as_any_mut(&mut self) -> &mut dyn Any;
fn on_event(&mut self, callback: Box<dyn FnMut(Event)>);
fn on_event(&mut self, callback: Box<dyn FnMut(Event) -> bool>);
fn on_active_status_change(&mut self, callback: Box<dyn FnMut(bool)>);
fn on_resize(&mut self, callback: Box<dyn FnMut()>);
fn on_close(&mut self, callback: Box<dyn FnOnce()>);