From 9d66bec7f60a9767b7ec0acac747dbfecc87899c Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 28 Mar 2021 07:55:21 +0300 Subject: macOS: Recreate menus after language changes IssueID #192 --- src/macos.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/macos.m') diff --git a/src/macos.m b/src/macos.m index 019533bd..0dcc3ef5 100644 --- a/src/macos.m +++ b/src/macos.m @@ -460,6 +460,12 @@ static void setShortcut_NSMenuItem_(NSMenuItem *item, int key, int kmods) { delete_String(str); } +void removeMenu_MacOS(int atIndex) { + NSApplication *app = [NSApplication sharedApplication]; + NSMenu *appMenu = [app mainMenu]; + [appMenu removeItemAtIndex:atIndex]; +} + void insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem *items, size_t count) { NSApplication *app = [NSApplication sharedApplication]; MyDelegate *myDel = (MyDelegate *) app.delegate; -- cgit v1.2.3