menu
Enumerations
NativeIcon
A native Icon to be used for the menu item
Platform-specific:
- Windows / Linux: Unsupported.
Enumeration Members
Add
An add item template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L19
Advanced
Advanced preferences toolbar icon for the preferences window.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L21
Bluetooth
A Bluetooth template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L23
Bookmarks
Bookmarks image suitable for a template.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L25
Caution
A caution image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L27
ColorPanel
A color panel toolbar icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L29
ColumnView
A column view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L31
Computer
A computer icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L33
EnterFullScreen
An enter full-screen mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L35
Everyone
Permissions for all users.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L37
ExitFullScreen
An exit full-screen mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L39
FlowView
A cover flow view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L41
Folder
A folder image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L43
FolderBurnable
A burnable folder icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L45
FolderSmart
A smart folder icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L47
FollowLinkFreestanding
A link template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L49
FontPanel
A font panel toolbar icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L51
GoLeft
A go back
template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L53
GoRight
A go forward
template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L55
Home
Home image suitable for a template.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L57
IChatTheater
An iChat Theater template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L59
IconView
An icon view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L61
Info
An information toolbar icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L63
InvalidDataFreestanding
A template image used to denote invalid data.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L65
LeftFacingTriangle
A generic left-facing triangle template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L67
ListView
A list view mode template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L69
LockLocked
A locked padlock template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L71
LockUnlocked
An unlocked padlock template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L73
MenuMixedState
A horizontal dash, for use in menus.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L75
MenuOnState
A check mark template image, for use in menus.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L77
MobileMe
A MobileMe icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L79
MultipleDocuments
A drag image for multiple items.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L81
Network
A network icon.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L83
Path
A path button template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L85
PreferencesGeneral
General preferences toolbar icon for the preferences window.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L87
QuickLook
A Quick Look template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L89
Refresh
A refresh template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L93
RefreshFreestanding
A refresh template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L91
Remove
A remove item template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L95
RevealFreestanding
A reveal contents template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L97
RightFacingTriangle
A generic right-facing triangle template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L99
Share
A share view template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L101
Slideshow
A slideshow template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L103
SmartBadge
A badge for a smart
item.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L105
StatusAvailable
Small green indicator, similar to iChat’s available image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L107
StatusNone
Small clear indicator.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L109
StatusPartiallyAvailable
Small yellow indicator, similar to iChat’s idle image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L111
StatusUnavailable
Small red indicator, similar to iChat’s unavailable image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L113
StopProgress
A stop progress button template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L117
StopProgressFreestanding
A stop progress template image.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L115
TrashEmpty
An image of the empty trash can.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L119
TrashFull
An image of the full trash can.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L121
User
Permissions for a single user.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L123
UserAccounts
User account toolbar icon for the preferences window.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L125
UserGroup
Permissions for a group of users.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L127
UserGuest
Permissions for guests.
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L129
Classes
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
MenuItemBase
Accessors
id
Get Signature
The id of this item.
Returns
string
Inherited from
MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L114
rid
Get Signature
Returns
number
Inherited from
MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L297
Methods
close()
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
Promise
<void
>
Inherited from
MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L309
isChecked()
Returns whether this check menu item is checked or not.
Returns
Promise
<boolean
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L71
isEnabled()
Returns whether this check menu item is enabled or not.
Returns
Promise
<boolean
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L48
setAccelerator()
Sets the accelerator for this check menu item.
Parameters
Parameter | Type |
---|---|
accelerator | null | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L62
setChecked()
Sets whether this check menu item is checked or not.
Parameters
Parameter | Type |
---|---|
checked | boolean |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L76
setEnabled()
Sets whether this check menu item is enabled or not.
Parameters
Parameter | Type |
---|---|
enabled | boolean |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L53
setText()
Sets the text for this check menu item.
Parameters
Parameter | Type |
---|---|
text | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L39
text()
Returns the text of this check menu item.
Returns
Promise
<string
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L34
new()
Create a new check menu item.
Parameters
Parameter | Type |
---|---|
opts | CheckMenuItemOptions |
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/checkMenuItem.ts#L27
IconMenuItem
An icon menu item inside a Menu
or Submenu
and usually contains an icon and a text.
Extends
MenuItemBase
Accessors
id
Get Signature
The id of this item.
Returns
string
Inherited from
MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L114
rid
Get Signature
Returns
number
Inherited from
MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L297
Methods
close()
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
Promise
<void
>
Inherited from
MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L309
isEnabled()
Returns whether this icon menu item is enabled or not.
Returns
Promise
<boolean
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L177
setAccelerator()
Sets the accelerator for this icon menu item.
Parameters
Parameter | Type |
---|---|
accelerator | null | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L191
setEnabled()
Sets whether this icon menu item is enabled or not.
Parameters
Parameter | Type |
---|---|
enabled | boolean |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L182
setIcon()
Sets an icon for this icon menu item
Parameters
Parameter | Type |
---|---|
icon | | null | string | Uint8Array | number [] | ArrayBuffer | Image |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L200
setText()
Sets the text for this icon menu item.
Parameters
Parameter | Type |
---|---|
text | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L168
text()
Returns the text of this icon menu item.
Returns
Promise
<string
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L163
new()
Create a new icon menu item.
Parameters
Parameter | Type |
---|---|
opts | IconMenuItemOptions |
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L158
Menu
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
MenuItemBase
Accessors
id
Get Signature
The id of this item.
Returns
string
Inherited from
MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L114
rid
Get Signature
Returns
number
Inherited from
MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L297
Methods
append()
Add a menu item to the end of this menu.
Platform-specific:
Type Parameters
Type Parameter |
---|
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
Parameter | Type |
---|---|
items | T | T [] |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L101
close()
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
Promise
<void
>
Inherited from
MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L309
get()
Retrieves the menu item matching the given identifier.
Parameters
Parameter | Type |
---|---|
id | string |
Returns
Promise
<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L224
insert()
Add a menu item to the specified position in this menu.
Platform-specific:
Type Parameters
Type Parameter |
---|
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
Parameter | Type |
---|---|
items | T | T [] |
position | number |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L159
items()
Returns a list of menu items that has been added to this menu.
Returns
Promise
<(
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem
)[]>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L212
popup()
Popup this menu as a context menu on the specified window.
If the position, is provided, it is relative to the window’s top-left corner.
Parameters
Parameter | Type |
---|---|
at ? | LogicalPosition | PhysicalPosition | Position |
window ? | Window |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L246
prepend()
Add a menu item to the beginning of this menu.
Platform-specific:
Type Parameters
Type Parameter |
---|
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
Parameter | Type |
---|---|
items | T | T [] |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L130
remove()
Remove a menu item from this menu.
Parameters
Parameter | Type |
---|---|
item | | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L183
removeAt()
Remove a menu item from this menu at the specified position.
Parameters
Parameter | Type |
---|---|
position | number |
Returns
Promise
<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L194
setAsAppMenu()
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
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L264
setAsWindowMenu()
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.setAsAppMenu
instead.
Parameters
Parameter | Type |
---|---|
window ? | Window |
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L278
default()
Create a default menu.
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L88
new()
Create a new menu.
Parameters
Parameter | Type |
---|---|
opts ? | MenuOptions |
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L83
MenuItem
A menu item inside a Menu
or Submenu
and contains only text.
Extends
MenuItemBase
Accessors
id
Get Signature
The id of this item.
Returns
string
Inherited from
MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L114
rid
Get Signature
Returns
number
Inherited from
MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L297
Methods
close()
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
Promise
<void
>
Inherited from
MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L309
isEnabled()
Returns whether this menu item is enabled or not.
Returns
Promise
<boolean
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L49
setAccelerator()
Sets the accelerator for this menu item.
Parameters
Parameter | Type |
---|---|
accelerator | null | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L63
setEnabled()
Sets whether this menu item is enabled or not.
Parameters
Parameter | Type |
---|---|
enabled | boolean |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L54
setText()
Sets the text for this menu item.
Parameters
Parameter | Type |
---|---|
text | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L40
text()
Returns the text of this menu item.
Returns
Promise
<string
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L35
new()
Create a new menu item.
Parameters
Parameter | Type |
---|---|
opts | MenuItemOptions |
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L30
PredefinedMenuItem
A predefined (native) menu item which has a predefined behavior by the OS or by tauri.
Extends
MenuItemBase
Accessors
id
Get Signature
The id of this item.
Returns
string
Inherited from
MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L114
rid
Get Signature
Returns
number
Inherited from
MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L297
Methods
close()
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
Promise
<void
>
Inherited from
MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L309
setText()
Sets the text for this predefined menu item.
Parameters
Parameter | Type |
---|---|
text | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L132
text()
Returns the text of this predefined menu item.
Returns
Promise
<string
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L127
new()
Create a new predefined menu item.
Parameters
Parameter | Type |
---|---|
opts ? | PredefinedMenuItemOptions |
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L118
Submenu
A type that is a submenu inside a Menu
or Submenu
.
Extends
MenuItemBase
Accessors
id
Get Signature
The id of this item.
Returns
string
Inherited from
MenuItemBase.id
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/base.ts#L114
rid
Get Signature
Returns
number
Inherited from
MenuItemBase.rid
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L297
Methods
append()
Add a menu item to the end of this submenu.
Platform-specific:
Type Parameters
Type Parameter |
---|
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
Parameter | Type |
---|---|
items | T | T [] |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L98
close()
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
Promise
<void
>
Inherited from
MenuItemBase.close
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/core.ts#L309
get()
Retrieves the menu item matching the given identifier.
Parameters
Parameter | Type |
---|---|
id | string |
Returns
Promise
<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L221
insert()
Add a menu item to the specified position in this submenu.
Platform-specific:
Type Parameters
Type Parameter |
---|
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
Parameter | Type |
---|---|
items | T | T [] |
position | number |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L156
isEnabled()
Returns whether this submenu is enabled or not.
Returns
Promise
<boolean
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L78
items()
Returns a list of menu items that has been added to this submenu.
Returns
Promise
<(
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem
)[]>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L209
popup()
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
Parameter | Type |
---|---|
at ? | LogicalPosition | PhysicalPosition |
window ? | Window |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L243
prepend()
Add a menu item to the beginning of this submenu.
Platform-specific:
Type Parameters
Type Parameter |
---|
T extends | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
Parameter | Type |
---|---|
items | T | T [] |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L127
remove()
Remove a menu item from this submenu.
Parameters
Parameter | Type |
---|---|
item | | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L180
removeAt()
Remove a menu item from this submenu at the specified position.
Parameters
Parameter | Type |
---|---|
position | number |
Returns
Promise
<
| null
| CheckMenuItem
| IconMenuItem
| PredefinedMenuItem
| Submenu
| MenuItem
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L191
setAsHelpMenuForNSApp()
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
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L283
setAsWindowsMenuForNSApp()
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
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L265
setEnabled()
Sets whether this submenu is enabled or not.
Parameters
Parameter | Type |
---|---|
enabled | boolean |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L83
setText()
Sets the text for this submenu.
Parameters
Parameter | Type |
---|---|
text | string |
Returns
Promise
<void
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L69
text()
Returns the text of this submenu.
Returns
Promise
<string
>
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L64
new()
Create a new submenu.
Parameters
Parameter | Type |
---|---|
opts | SubmenuOptions |
Returns
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L59
Interfaces
AboutMetadata
A metadata for the about predefined menu item.
Properties
CheckMenuItemOptions
Options for creating a new check menu item.
Extends
Properties
IconMenuItemOptions
Options for creating a new icon menu item.
Extends
Properties
Property | Type | Description | Inherited from | Defined in |
---|---|---|---|---|
accelerator? | string | Specify an accelerator for the new menu item. | MenuItemOptions .accelerator | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L17 |
action? | (id : string ) => void | Specify a handler to be called when this menu item is activated. | MenuItemOptions .action | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L19 |
enabled? | boolean | Whether the new menu item is enabled or not. | MenuItemOptions .enabled | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L15 |
icon? | | string | Uint8Array | number [] | ArrayBuffer | Image | 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: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/iconMenuItem.ts#L144 |
id? | string | Specify an id to use for the new menu item. | MenuItemOptions .id | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L11 |
text | string | The text of the new menu item. | MenuItemOptions .text | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L13 |
MenuItemOptions
Options for creating a new menu item.
Extended by
Properties
Property | Type | Description | Defined in |
---|---|---|---|
accelerator? | string | Specify an accelerator for the new menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L17 |
action? | (id : string ) => void | Specify a handler to be called when this menu item is activated. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L19 |
enabled? | boolean | Whether the new menu item is enabled or not. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L15 |
id? | string | Specify an id to use for the new menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L11 |
text | string | The text of the new menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menuItem.ts#L13 |
MenuOptions
Options for creating a new menu.
Properties
Property | Type | Description | Defined in |
---|---|---|---|
id? | string | Specify an id to use for the new menu. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L53 |
items? | ( | CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem )[] | List of items to add to the new menu. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/menu.ts#L55 |
PredefinedMenuItemOptions
Options for creating a new predefined menu item.
Properties
Property | Type | Description | Defined in |
---|---|---|---|
item | | object | "Separator" | "Copy" | "Cut" | "Paste" | "SelectAll" | "Undo" | "Redo" | "Minimize" | "Maximize" | "Fullscreen" | "Hide" | "HideOthers" | "ShowAll" | "CloseWindow" | "Quit" | "Services" | The predefined item type | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L88 |
text? | string | The text of the new predefined menu item. | Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/predefinedMenuItem.ts#L86 |
Type Aliases
SubmenuOptions
Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/menu/submenu.ts#L48
© 2024 Tauri Contributors. CC-BY / MIT