Zum Hauptteil springen

ShareMenu

The ShareMenu class creates Share Menu on macOS, which can be used to share information from the current context to apps, social media accounts, and other services.

For including the share menu as a submenu of other menus, please use the shareMenu role of MenuItem.

Class: ShareMenu

Create share menu on macOS.

Prozess: Haupt

new ShareMenu(sharingItem)

  • sharingItem SharingItem - The item to share.

Creates a new share menu.

Beispiel Methoden

Das shareMenu Objekt hat die folgenden Instanz Methoden:

shareMenu.popup([options])

  • options PopupOptions (optional)
    • browserWindow BrowserWindow (optional) - Default ist das fokussierte Fenster.
    • x number (optional) - Default is the current mouse cursor position. Must be declared if y is declared.
    • y number (optional) - Default is the current mouse cursor position. Must be declared if x is declared.
    • positioningItem number (optional) macOS - The index of the menu item to be positioned under the mouse cursor at the specified coordinates. Default is -1.
    • callback Funktion (optional) - Wird aufgerufen wenn das Menü geschlossen wird.

Pops up this menu as a context menu in the BrowserWindow.

shareMenu.closePopup([browserWindow])

  • browserWindow BrowserWindow (optional) - Default ist das fokussierte Fenster.

Schließt das Kontext-Menü im browserWindow.