Draft conversion::menu_message in iced_winit

... and wire it up to the runtime loop
This commit is contained in:
Héctor Ramón Jiménez 2021-07-13 20:55:21 +02:00
parent f3b056a6fc
commit 6221adf2b1
No known key found for this signature in database
GPG key ID: 44B88EB52AB1EE8D
3 changed files with 31 additions and 0 deletions

View file

@ -215,6 +215,17 @@ pub fn menu<Message>(menu: &Menu<Message>) -> 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<Message>(
_menu: &Menu<Message>,
id: isize,
) -> Option<Message> {
println!("Menu entry activated: {}", id);
None
}
/// Converts a `MouseCursor` from [`iced_native`] to a [`winit`] cursor icon.
///
/// [`winit`]: https://github.com/rust-windowing/winit