ApplicationMenus.swift 769 B

123456789101112131415161718192021
  1. extension BackendFeatures {
  2. /// Backend methods for setting an app's global menu.
  3. ///
  4. /// These are used by ``Scene/commands(_:)`` and related types.
  5. @MainActor
  6. public protocol ApplicationMenus: Core {
  7. /// Sets the application's global menu.
  8. ///
  9. /// Some backends may make use of the host platform's global menu bar
  10. /// (such as macOS's menu bar), and others may render their own menu bar
  11. /// within the application.
  12. ///
  13. /// - Parameters:
  14. /// - submenus: The submenus of the global menu.
  15. /// - environment: The menu's environment.
  16. func setApplicationMenu(
  17. _ submenus: [ResolvedMenu.Submenu],
  18. environment: EnvironmentValues
  19. )
  20. }
  21. }