Fix winit example

This commit is contained in:
Yu-Wei Wu 2022-05-08 19:38:30 +08:00
parent 413358ed85
commit 1e33121a8f
No known key found for this signature in database
GPG key ID: 3C5E0AA459C7E6E4
2 changed files with 5 additions and 6 deletions

View file

@ -1,6 +1,6 @@
# muda
Menu utilities for Desktop Applications.
Menu Utilities for Desktop Applications.
## Example

View file

@ -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,
..