1

I've successfully ported my Chord calculus app to Mac Catalyst, with working key commands, context menus and multiple scenes. Can even screen capture the fretboard to the clipboard for developing tutorial content. Still working on saving it to a file, but have gotten the DocumentView working, so it's just grunt work to finish that.

I am currently working on mode-dependent main menu items. I am wanting to change the simple "about App" menu item, but it's not clear what to do. I can replace it with the builder.replace() method, but I get a menu pointing to a submenu. Would like a simple button to generate an "alert" type response. Suggestions?

polymerchm
  • 188
  • 1
  • 7

2 Answers2

2

Try using replaceChildren(ofMenu:from:) with .application, which is the About menu item’s parent. The closure will give you the list of children, one of which should be .about, and you can return a new list with your replacement.

That said, you can customize the default About box by providing a Credits.rtf file, which might be all you need: https://blog.kulman.sk/editing-macos-app-about-dialog/

Adam
  • 4,405
  • 16
  • 23
1
let action = UIAction(title: "about Chord Calculus", handler: {
  par in
  print("test action")
})

builder.replace(menu: .about, with:
  UIMenu(title: "", image: nil, identifier: .about,
    options: .displayInline, children: [action]))
polymerchm
  • 188
  • 1
  • 7