From 6221adf2b1b1e8150931d4175e1e36870d45f6e5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 13 Jul 2021 20:55:21 +0200 Subject: Draft `conversion::menu_message` in `iced_winit` ... and wire it up to the runtime loop --- winit/src/conversion.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'winit/src/conversion.rs') 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 -- cgit