TrayMenuBuilder

interface TrayMenuBuilder

Interface for building tray menus in a platform-independent manner. Implementations of this interface allow the creation of tray menus with items, checkable items, submenus, and dividers, and provide a mechanism for disposing resources when the menu is no longer needed.

Inheritors

Functions

Link copied to clipboard
abstract fun CheckableItem(label: String, checked: Boolean = false, isEnabled: Boolean = true, onToggle: (Boolean) -> Unit)

Adds a checkable item to the tray menu.

Link copied to clipboard
abstract fun dispose()

Disposes of the resources associated with the tray menu. This method should be called when the tray menu is no longer in use to release any system resources held by it.

Link copied to clipboard
abstract fun Divider()

Adds a visual separator (divider) to the tray menu. This method is used to group or separate menu items, providing better organization and clarity within the menu structure.

Link copied to clipboard
abstract fun Item(label: String, isEnabled: Boolean = true, onClick: () -> Unit = {})

Adds an item to the tray menu.

Link copied to clipboard
abstract fun SubMenu(label: String, isEnabled: Boolean = true, submenuContent: TrayMenuBuilder.() -> Unit?)

Adds a submenu to the tray menu.