콘텐츠로 이동

MenuItem

이 콘텐츠는 아직 번역되지 않았습니다.

Module @netwiv/api/menu · Kind Class

import { MenuItem } from '@netwiv/api/menu';

A menu item inside a {@linkcode Menu } or {@linkcode Submenu } and contains only text.

new MenuItem(rid: number, id: string)
new(opts: MenuItemOptions): Promise<MenuItem>

Create a new menu item.

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.

id: string

The id of this item.

isEnabled(): Promise<boolean>

Returns whether this menu item is enabled or not.

rid: number
setAccelerator(accelerator: string | null): Promise<void>

Sets the accelerator for this menu item.

setEnabled(enabled: boolean): Promise<void>

Sets whether this menu item is enabled or not.

setText(text: string): Promise<void>

Sets the text for this menu item.

text(): Promise<string>

Returns the text of this menu item.


Descriptions come from the pinned @tauri-apps/api@2.11.1 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.