From 1e33121a8f61843ccfbdcb0055fbf178bf5ac886 Mon Sep 17 00:00:00 2001 From: Yu-Wei Wu Date: Sun, 8 May 2022 19:38:30 +0800 Subject: [PATCH] Fix winit example --- README.md | 2 +- examples/winit.rs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4e923c2..357ad79 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # muda -Menu utilities for Desktop Applications. +Menu Utilities for Desktop Applications. ## Example diff --git a/examples/winit.rs b/examples/winit.rs index 4861487..2f7e321 100644 --- a/examples/winit.rs +++ b/examples/winit.rs @@ -31,11 +31,6 @@ fn main() { menu_bar.init_for_hwnd(_window2.hwnd() as _); } - #[cfg(target_os = "macos")] - { - menu_bar.init_for_nsapp(); - } - let menu_channel = menu_event_receiver(); let mut open_item_disabled = false; let mut counter = 0; @@ -61,6 +56,10 @@ fn main() { } match event { + #[cfg(target_os = "macos")] + Event::NewEvents(winit::event::StartCause::Init) => { + menu_bar.init_for_nsapp(); + }, Event::WindowEvent { event: WindowEvent::CloseRequested, ..