menuItem

fun PopupMenu.menuItem(text: String, style: String = defaultStyle, init: MenuItem.() -> Unit = {}): MenuItem

Adds new MenuItem to this PopupMenu.

Return

a new instance of MenuItem added to this PopupMenu.

Parameters

text

will be displayed by the MenuItem.

style

name of a MenuItem.MenuItemStyle.

init

allows to customize the MenuItem.


fun PopupMenu.menuItem(text: String, image: Image, style: String = defaultStyle, init: MenuItem.() -> Unit = {}): MenuItem

Adds new MenuItem to this PopupMenu.

Return

a new instance of MenuItem added to this PopupMenu.

Parameters

text

will be displayed by the MenuItem.

image

will be displayed by the MenuItem.

style

name of a MenuItem.MenuItemStyle.

init

allows to customize the MenuItem.


fun PopupMenu.menuItem(text: String, drawable: Drawable, style: String = defaultStyle, init: MenuItem.() -> Unit = {}): MenuItem

Adds new MenuItem to this PopupMenu.

Return

a new instance of MenuItem added to this PopupMenu.

Parameters

text

will be displayed by the MenuItem.

drawable

will be displayed by the MenuItem.

style

name of a MenuItem.MenuItemStyle.

init

allows to customize the MenuItem.


fun PopupMenu.menuItem(text: String, drawableName: String, style: String = defaultStyle, init: MenuItem.() -> Unit = {}): MenuItem

Adds new MenuItem to this PopupMenu.

Return

a new instance of MenuItem added to this PopupMenu.

Parameters

text

will be displayed by the MenuItem.

drawableName

will be used to find a Drawable to be displayed by the MenuItem.

style

name of a MenuItem.MenuItemStyle.

init

allows to customize the MenuItem.