Posts

Post not yet marked as solved
15 Replies
3.7k Views
How do I set tick/check marks at a menu item at runtime?Main menu -> Submenu -> ItemMy best shot is this code, which compiles OK: let mainMenu = NSApplication.shared.mainMenu! let subMenu = mainMenu.item(withTitle: "Main menu")?.menu let menuItem = subMenu?.item(withTitle: "Submenu")?.submenu menuItem?.item(withTitle: "Item")?.isEnabled = trueAny help for a novice is appreciated.I have the following, which toggles check marks at mouse clicks:sender.state = sender.state == NSControl.StateValue.on ? NSControl.StateValue.off : NSControl.StateValue.on
Posted
by Mogens.
Last updated
.