diff --git a/glutin/src/application.rs b/glutin/src/application.rs
index 279b6c77..991c8705 100644
--- a/glutin/src/application.rs
+++ b/glutin/src/application.rs
@@ -306,6 +306,16 @@ async fn run_instance(
// TODO: Handle animations!
// Maybe we can use `ControlFlow::WaitUntil` for this.
}
+ event::Event::WindowEvent {
+ event: event::WindowEvent::MenuEntryActivated(entry_id),
+ ..
+ } => {
+ if let Some(message) =
+ conversion::menu_message(state.menu(), entry_id)
+ {
+ messages.push(message);
+ }
+ }
event::Event::WindowEvent {
event: window_event,
..
diff --git a/winit/src/application.rs b/winit/src/application.rs
index bf4b2489..ada64dfc 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -386,6 +386,16 @@ async fn run_instance(
// TODO: Handle animations!
// Maybe we can use `ControlFlow::WaitUntil` for this.
}
+ event::Event::WindowEvent {
+ event: event::WindowEvent::MenuEntryActivated(entry_id),
+ ..
+ } => {
+ if let Some(message) =
+ conversion::menu_message(state.menu(), entry_id)
+ {
+ messages.push(message);
+ }
+ }
event::Event::WindowEvent {
event: window_event,
..
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index 3c483086..51db615b 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -215,6 +215,17 @@ pub fn menu(menu: &Menu) -> winit::window::Menu {
converted
}
+/// Given a [`Menu`] and an identifier of a [`menu::Entry`], it returns the
+/// `Message` that should be produced when that entry is activated.
+pub fn menu_message(
+ _menu: &Menu,
+ id: isize,
+) -> Option {
+ println!("Menu entry activated: {}", id);
+
+ None
+}
+
/// Converts a `MouseCursor` from [`iced_native`] to a [`winit`] cursor icon.
///
/// [`winit`]: https://github.com/rust-windowing/winit