콘텐츠로 이동

IconMenuItem

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

Module @netwiv/api/menu · Kind Class

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

An icon menu item inside a {@linkcode Menu } or {@linkcode Submenu } and usually contains an icon and a text.

new IconMenuItem(rid: number, id: string)
new(opts: IconMenuItemOptions): Promise<IconMenuItem>

Create a new icon 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 icon menu item is enabled or not.

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

Sets the accelerator for this icon menu item.

setEnabled(enabled: boolean): Promise<void>

Sets whether this icon menu item is enabled or not.

setIcon(icon: MenuIcon | null): Promise<void>

Sets an icon for this icon menu item

setText(text: string): Promise<void>

Sets the text for this icon menu item.

text(): Promise<string>

Returns the text of this icon 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.