menu
Enumerations
Section titled “Enumerations”NativeIcon
Section titled “NativeIcon”A native Icon to be used for the menu item
Platform-specific:
- Windows / Linux: Unsupported.
Enumeration Members
Section titled “Enumeration Members”Add: "Add";An add item template image.
Source: undefined
Advanced
Section titled “Advanced”Advanced: "Advanced";Advanced preferences toolbar icon for the preferences window.
Source: undefined
Bluetooth
Section titled “Bluetooth”Bluetooth: "Bluetooth";A Bluetooth template image.
Source: undefined
Bookmarks
Section titled “Bookmarks”Bookmarks: "Bookmarks";Bookmarks image suitable for a template.
Source: undefined
Caution
Section titled “Caution”Caution: "Caution";A caution image.
Source: undefined
ColorPanel
Section titled “ColorPanel”ColorPanel: "ColorPanel";A color panel toolbar icon.
Source: undefined
ColumnView
Section titled “ColumnView”ColumnView: "ColumnView";A column view mode template image.
Source: undefined
Computer
Section titled “Computer”Computer: "Computer";A computer icon.
Source: undefined
EnterFullScreen
Section titled “EnterFullScreen”EnterFullScreen: "EnterFullScreen";An enter full-screen mode template image.
Source: undefined
Everyone
Section titled “Everyone”Everyone: "Everyone";Permissions for all users.
Source: undefined
ExitFullScreen
Section titled “ExitFullScreen”ExitFullScreen: "ExitFullScreen";An exit full-screen mode template image.
Source: undefined
FlowView
Section titled “FlowView”FlowView: "FlowView";A cover flow view mode template image.
Source: undefined
Folder
Section titled “Folder”Folder: "Folder";A folder image.
Source: undefined
FolderBurnable
Section titled “FolderBurnable”FolderBurnable: "FolderBurnable";A burnable folder icon.
Source: undefined
FolderSmart
Section titled “FolderSmart”FolderSmart: "FolderSmart";A smart folder icon.
Source: undefined
FollowLinkFreestanding
Section titled “FollowLinkFreestanding”FollowLinkFreestanding: "FollowLinkFreestanding";A link template image.
Source: undefined
FontPanel
Section titled “FontPanel”FontPanel: "FontPanel";A font panel toolbar icon.
Source: undefined
GoLeft
Section titled “GoLeft”GoLeft: "GoLeft";A go back template image.
Source: undefined
GoRight
Section titled “GoRight”GoRight: "GoRight";A go forward template image.
Source: undefined
Home: "Home";Home image suitable for a template.
Source: undefined
IChatTheater
Section titled “IChatTheater”IChatTheater: "IChatTheater";An iChat Theater template image.
Source: undefined
IconView
Section titled “IconView”IconView: "IconView";An icon view mode template image.
Source: undefined
Info: "Info";An information toolbar icon.
Source: undefined
InvalidDataFreestanding
Section titled “InvalidDataFreestanding”InvalidDataFreestanding: "InvalidDataFreestanding";A template image used to denote invalid data.
Source: undefined
LeftFacingTriangle
Section titled “LeftFacingTriangle”LeftFacingTriangle: "LeftFacingTriangle";A generic left-facing triangle template image.
Source: undefined
ListView
Section titled “ListView”ListView: "ListView";A list view mode template image.
Source: undefined
LockLocked
Section titled “LockLocked”LockLocked: "LockLocked";A locked padlock template image.
Source: undefined
LockUnlocked
Section titled “LockUnlocked”LockUnlocked: "LockUnlocked";An unlocked padlock template image.
Source: undefined
MenuMixedState
Section titled “MenuMixedState”MenuMixedState: "MenuMixedState";A horizontal dash, for use in menus.
Source: undefined
MenuOnState
Section titled “MenuOnState”MenuOnState: "MenuOnState";A check mark template image, for use in menus.
Source: undefined
MobileMe
Section titled “MobileMe”MobileMe: "MobileMe";A MobileMe icon.
Source: undefined
MultipleDocuments
Section titled “MultipleDocuments”MultipleDocuments: "MultipleDocuments";A drag image for multiple items.
Source: undefined
Network
Section titled “Network”Network: "Network";A network icon.
Source: undefined
Path: "Path";A path button template image.
Source: undefined
PreferencesGeneral
Section titled “PreferencesGeneral”PreferencesGeneral: "PreferencesGeneral";General preferences toolbar icon for the preferences window.
Source: undefined
QuickLook
Section titled “QuickLook”QuickLook: "QuickLook";A Quick Look template image.
Source: undefined
Refresh
Section titled “Refresh”Refresh: "Refresh";A refresh template image.
Source: undefined
RefreshFreestanding
Section titled “RefreshFreestanding”RefreshFreestanding: "RefreshFreestanding";A refresh template image.
Source: undefined
Remove
Section titled “Remove”Remove: "Remove";A remove item template image.
Source: undefined
RevealFreestanding
Section titled “RevealFreestanding”RevealFreestanding: "RevealFreestanding";A reveal contents template image.
Source: undefined
RightFacingTriangle
Section titled “RightFacingTriangle”RightFacingTriangle: "RightFacingTriangle";A generic right-facing triangle template image.
Source: undefined
Share: "Share";A share view template image.
Source: undefined
Slideshow
Section titled “Slideshow”Slideshow: "Slideshow";A slideshow template image.
Source: undefined
SmartBadge
Section titled “SmartBadge”SmartBadge: "SmartBadge";A badge for a smart item.
Source: undefined
StatusAvailable
Section titled “StatusAvailable”StatusAvailable: "StatusAvailable";Small green indicator, similar to iChat’s available image.
Source: undefined
StatusNone
Section titled “StatusNone”StatusNone: "StatusNone";Small clear indicator.
Source: undefined
StatusPartiallyAvailable
Section titled “StatusPartiallyAvailable”StatusPartiallyAvailable: "StatusPartiallyAvailable";Small yellow indicator, similar to iChat’s idle image.
Source: undefined
StatusUnavailable
Section titled “StatusUnavailable”StatusUnavailable: "StatusUnavailable";Small red indicator, similar to iChat’s unavailable image.
Source: undefined
StopProgress
Section titled “StopProgress”StopProgress: "StopProgress";A stop progress button template image.
Source: undefined
StopProgressFreestanding
Section titled “StopProgressFreestanding”StopProgressFreestanding: "StopProgressFreestanding";A stop progress template image.
Source: undefined
TrashEmpty
Section titled “TrashEmpty”TrashEmpty: "TrashEmpty";An image of the empty trash can.
Source: undefined
TrashFull
Section titled “TrashFull”TrashFull: "TrashFull";An image of the full trash can.
Source: undefined
User: "User";Permissions for a single user.
Source: undefined
UserAccounts
Section titled “UserAccounts”UserAccounts: "UserAccounts";User account toolbar icon for the preferences window.
Source: undefined
UserGroup
Section titled “UserGroup”UserGroup: "UserGroup";Permissions for a group of users.
Source: undefined
UserGuest
Section titled “UserGuest”UserGuest: "UserGuest";Permissions for guests.
Source: undefined
Classes
Section titled “Classes”CheckMenuItem
Section titled “CheckMenuItem”A check menu item inside a Menu or Submenu
and usually contains a text and a check mark or a similar toggle
that corresponds to a checked and unchecked states.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: undefined
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: undefined
Methods
Section titled “Methods”close()
Section titled “close()”close(): Promise<void>Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: undefined
isChecked()
Section titled “isChecked()”isChecked(): Promise<boolean>Returns whether this check menu item is checked or not.
Returns
Section titled “Returns”Promise<boolean>
Source: undefined
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this check menu item is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: undefined
setAccelerator()
Section titled “setAccelerator()”setAccelerator(accelerator): Promise<void>Sets the accelerator for this check menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accelerator |
null | string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setChecked()
Section titled “setChecked()”setChecked(checked): Promise<void>Sets whether this check menu item is checked or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
checked |
boolean |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this check menu item is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled |
boolean |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this check menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
text()
Section titled “text()”text(): Promise<string>Returns the text of this check menu item.
Returns
Section titled “Returns”Promise<string>
Source: undefined
static new(opts): Promise<CheckMenuItem>Create a new check menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
CheckMenuItemOptions |
Returns
Section titled “Returns”Source: undefined
IconMenuItem
Section titled “IconMenuItem”An icon menu item inside a Menu or Submenu
and usually contains an icon and a text.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: undefined
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: undefined
Methods
Section titled “Methods”close()
Section titled “close()”close(): Promise<void>Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: undefined
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this icon menu item is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: undefined
setAccelerator()
Section titled “setAccelerator()”setAccelerator(accelerator): Promise<void>Sets the accelerator for this icon menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accelerator |
null | string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this icon menu item is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled |
boolean |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setIcon()
Section titled “setIcon()”setIcon(icon): Promise<void>Sets an icon for this icon menu item
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
icon |
null | MenuIcon |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this icon menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
text()
Section titled “text()”text(): Promise<string>Returns the text of this icon menu item.
Returns
Section titled “Returns”Promise<string>
Source: undefined
static new(opts): Promise<IconMenuItem>Create a new icon menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
IconMenuItemOptions |
Returns
Section titled “Returns”Source: undefined
A type that is either a menu bar on the window on Windows and Linux or as a global menu in the menubar on macOS.
Platform-specific:
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: undefined
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: undefined
Methods
Section titled “Methods”append()
Section titled “append()”append<T>(items): Promise<void>Add a menu item to the end of this menu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: undefined
close()
Section titled “close()”close(): Promise<void>Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: undefined
get(id): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Retrieves the menu item matching the given identifier.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: undefined
insert()
Section titled “insert()”insert<T>(items, position): Promise<void>Add a menu item to the specified position in this menu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
T | T[] |
position |
number |
Returns
Section titled “Returns”Promise<void>
Source: undefined
items()
Section titled “items()”items(): Promise<( | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem)[]>Returns a list of menu items that has been added to this menu.
Returns
Section titled “Returns”Promise<(
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem)[]>
Source: undefined
popup()
Section titled “popup()”popup(at?, window?): Promise<void>Popup this menu as a context menu on the specified window.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
at? |
LogicalPosition | PhysicalPosition | Position |
If a position is provided, it is relative to the window’s top-left corner. If there isn’t one provided, the menu will pop up at the current location of the mouse. |
window? |
Window |
- |
Returns
Section titled “Returns”Promise<void>
Source: undefined
prepend()
Section titled “prepend()”prepend<T>(items): Promise<void>Add a menu item to the beginning of this menu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: undefined
remove()
Section titled “remove()”remove(item): Promise<void>Remove a menu item from this menu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
item |
| MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Returns
Section titled “Returns”Promise<void>
Source: undefined
removeAt()
Section titled “removeAt()”removeAt(position): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Remove a menu item from this menu at the specified position.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position |
number |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: undefined
setAsAppMenu()
Section titled “setAsAppMenu()”setAsAppMenu(): Promise<null | Menu>Sets the app-wide menu and returns the previous one.
If a window was not created with an explicit menu or had one set explicitly, this menu will be assigned to it.
Returns
Section titled “Returns”Source: undefined
setAsWindowMenu()
Section titled “setAsWindowMenu()”setAsWindowMenu(window?): Promise<null | Menu>Sets the window menu and returns the previous one.
Platform-specific:
- macOS: Unsupported. The menu on macOS is app-wide and not specific to one
window, if you need to set it, use
Menu.setAsAppMenuinstead.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
window? |
Window |
Returns
Section titled “Returns”Source: undefined
default()
Section titled “default()”static default(): Promise<Menu>Create a default menu.
Returns
Section titled “Returns”Source: undefined
static new(opts?): Promise<Menu>Create a new menu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts? |
MenuOptions |
Returns
Section titled “Returns”Source: undefined
MenuItem
Section titled “MenuItem”A menu item inside a Menu or Submenu and contains only text.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: undefined
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: undefined
Methods
Section titled “Methods”close()
Section titled “close()”close(): Promise<void>Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: undefined
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this menu item is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: undefined
setAccelerator()
Section titled “setAccelerator()”setAccelerator(accelerator): Promise<void>Sets the accelerator for this menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
accelerator |
null | string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this menu item is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled |
boolean |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
text()
Section titled “text()”text(): Promise<string>Returns the text of this menu item.
Returns
Section titled “Returns”Promise<string>
Source: undefined
static new(opts): Promise<MenuItem>Create a new menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
MenuItemOptions |
Returns
Section titled “Returns”Source: undefined
PredefinedMenuItem
Section titled “PredefinedMenuItem”A predefined (native) menu item which has a predefined behavior by the OS or by tauri.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: undefined
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: undefined
Methods
Section titled “Methods”close()
Section titled “close()”close(): Promise<void>Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: undefined
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this predefined menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
text()
Section titled “text()”text(): Promise<string>Returns the text of this predefined menu item.
Returns
Section titled “Returns”Promise<string>
Source: undefined
static new(opts?): Promise<PredefinedMenuItem>Create a new predefined menu item.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts? |
PredefinedMenuItemOptions |
Returns
Section titled “Returns”Source: undefined
Submenu
Section titled “Submenu”A type that is a submenu inside a Menu or Submenu.
Extends
Section titled “Extends”MenuItemBase
Accessors
Section titled “Accessors”get id(): stringThe id of this item.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”MenuItemBase.id
Source: undefined
get rid(): numberReturns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”MenuItemBase.rid
Source: undefined
Methods
Section titled “Methods”append()
Section titled “append()”append<T>(items): Promise<void>Add a menu item to the end of this submenu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: undefined
close()
Section titled “close()”close(): Promise<void>Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MenuItemBase.close
Source: undefined
get(id): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Retrieves the menu item matching the given identifier.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: undefined
insert()
Section titled “insert()”insert<T>(items, position): Promise<void>Add a menu item to the specified position in this submenu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
T | T[] |
position |
number |
Returns
Section titled “Returns”Promise<void>
Source: undefined
isEnabled()
Section titled “isEnabled()”isEnabled(): Promise<boolean>Returns whether this submenu is enabled or not.
Returns
Section titled “Returns”Promise<boolean>
Source: undefined
items()
Section titled “items()”items(): Promise<( | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem)[]>Returns a list of menu items that has been added to this submenu.
Returns
Section titled “Returns”Promise<(
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem)[]>
Source: undefined
popup()
Section titled “popup()”popup(at?, window?): Promise<void>Popup this submenu as a context menu on the specified window.
If the position, is provided, it is relative to the window’s top-left corner.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
at? |
LogicalPosition | PhysicalPosition |
window? |
Window |
Returns
Section titled “Returns”Promise<void>
Source: undefined
prepend()
Section titled “prepend()”prepend<T>(items): Promise<void>Add a menu item to the beginning of this submenu.
Platform-specific:
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
T | T[] |
Returns
Section titled “Returns”Promise<void>
Source: undefined
remove()
Section titled “remove()”remove(item): Promise<void>Remove a menu item from this submenu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
item |
| MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem |
Returns
Section titled “Returns”Promise<void>
Source: undefined
removeAt()
Section titled “removeAt()”removeAt(position): Promise< | null | MenuItem | PredefinedMenuItem | Submenu | CheckMenuItem| IconMenuItem>Remove a menu item from this submenu at the specified position.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position |
number |
Returns
Section titled “Returns”Promise<
| null
| MenuItem
| PredefinedMenuItem
| Submenu
| CheckMenuItem
| IconMenuItem>
Source: undefined
setAsHelpMenuForNSApp()
Section titled “setAsHelpMenuForNSApp()”setAsHelpMenuForNSApp(): Promise<void>Set this submenu as the Help menu for the application on macOS.
This will cause macOS to automatically add a search box to the menu.
If no menu is set as the Help menu, macOS will automatically use any menu which has a title matching the localized word “Help”.
Platform-specific:
- Windows / Linux: Unsupported.
Returns
Section titled “Returns”Promise<void>
Source: undefined
setAsWindowsMenuForNSApp()
Section titled “setAsWindowsMenuForNSApp()”setAsWindowsMenuForNSApp(): Promise<void>Set this submenu as the Window menu for the application on macOS.
This will cause macOS to automatically add window-switching items and certain other items to the menu.
Platform-specific:
- Windows / Linux: Unsupported.
Returns
Section titled “Returns”Promise<void>
Source: undefined
setEnabled()
Section titled “setEnabled()”setEnabled(enabled): Promise<void>Sets whether this submenu is enabled or not.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled |
boolean |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setIcon()
Section titled “setIcon()”setIcon(icon): Promise<void>Sets an icon for this submenu
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
icon |
null | MenuIcon |
Returns
Section titled “Returns”Promise<void>
Source: undefined
setText()
Section titled “setText()”setText(text): Promise<void>Sets the text for this submenu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”Promise<void>
Source: undefined
text()
Section titled “text()”text(): Promise<string>Returns the text of this submenu.
Returns
Section titled “Returns”Promise<string>
Source: undefined
static new(opts): Promise<Submenu>Create a new submenu.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
SubmenuOptions |
Returns
Section titled “Returns”Source: undefined
Interfaces
Section titled “Interfaces”AboutMetadata
Section titled “AboutMetadata”A metadata for the about predefined menu item.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
authors? |
string[] |
The authors of the application. Platform-specific - macOS: Unsupported. | Source: undefined |
comments? |
string |
Application comments. Platform-specific - macOS: Unsupported. | Source: undefined |
copyright? |
string |
The copyright of the application. | Source: undefined |
credits? |
string |
The credits. Platform-specific - Windows / Linux: Unsupported. | Source: undefined |
icon? |
| string | number[] | ArrayBuffer | Uint8Array<ArrayBufferLike> | Image |
The application icon. Platform-specific - Windows: Unsupported. | Source: undefined |
license? |
string |
The license of the application. Platform-specific - macOS: Unsupported. | Source: undefined |
name? |
string |
Sets the application name. | Source: undefined |
shortVersion? |
string |
The short version, e.g. “1.0”. Platform-specific - Windows / Linux: Appended to the end of version in parentheses. |
Source: undefined |
version? |
string |
The application version. | Source: undefined |
website? |
string |
The application website. Platform-specific - macOS: Unsupported. | Source: undefined |
websiteLabel? |
string |
The website label. Platform-specific - macOS: Unsupported. | Source: undefined |
CheckMenuItemOptions
Section titled “CheckMenuItemOptions”Options for creating a new check menu item.
Extends
Section titled “Extends”Properties
Section titled “Properties”| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
accelerator? |
string |
Specify an accelerator for the new menu item. | MenuItemOptions.accelerator |
Source: undefined |
action? |
(id: string) => void |
Specify a handler to be called when this menu item is activated. | MenuItemOptions.action |
Source: undefined |
checked? |
boolean |
Whether the new check menu item is enabled or not. | - | Source: undefined |
enabled? |
boolean |
Whether the new menu item is enabled or not. | MenuItemOptions.enabled |
Source: undefined |
id? |
string |
Specify an id to use for the new menu item. | MenuItemOptions.id |
Source: undefined |
text |
string |
The text of the new menu item. | MenuItemOptions.text |
Source: undefined |
IconMenuItemOptions
Section titled “IconMenuItemOptions”Options for creating a new icon menu item.
Extends
Section titled “Extends”Properties
Section titled “Properties”| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
accelerator? |
string |
Specify an accelerator for the new menu item. | MenuItemOptions.accelerator |
Source: undefined |
action? |
(id: string) => void |
Specify a handler to be called when this menu item is activated. | MenuItemOptions.action |
Source: undefined |
enabled? |
boolean |
Whether the new menu item is enabled or not. | MenuItemOptions.enabled |
Source: undefined |
icon? |
MenuIcon |
Icon to be used for the new icon menu item. Note that you may need the image-ico or image-png Cargo features to use this API. To enable it, change your Cargo.toml file: [dependencies] tauri = { version = "...", features = ["...", "image-png"] } |
- | Source: undefined |
id? |
string |
Specify an id to use for the new menu item. | MenuItemOptions.id |
Source: undefined |
text |
string |
The text of the new menu item. | MenuItemOptions.text |
Source: undefined |
MenuItemOptions
Section titled “MenuItemOptions”Options for creating a new menu item.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”MenuOptions
Section titled “MenuOptions”Options for creating a new menu.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
id? |
string |
Specify an id to use for the new menu. | Source: undefined |
items? |
( | MenuItemOptions | MenuItem | SubmenuOptions | PredefinedMenuItemOptions | CheckMenuItemOptions | IconMenuItemOptions | PredefinedMenuItem | Submenu | CheckMenuItem | IconMenuItem)[] |
List of items to add to the new menu. | Source: undefined |
PredefinedMenuItemOptions
Section titled “PredefinedMenuItemOptions”Options for creating a new predefined menu item.
Properties
Section titled “Properties”Type Aliases
Section titled “Type Aliases”SubmenuOptions
Section titled “SubmenuOptions”type SubmenuOptions: Omit<MenuItemOptions, "accelerator" | "action"> & MenuOptions & object;Type declaration
Section titled “Type declaration”| Name | Type | Description | Defined in |
|---|---|---|---|
icon |
MenuIcon |
Icon to be used for the submenu. Note: you may need the image-ico or image-png Cargo features to use this API. |
Source: undefined |
Source: undefined
Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站