MenuButton

Last updated 9 months ago

Pop Up Button Module.

API Overview

API Documentation

Functions

matches

Signature

cp.ui.MenuButton.matches(element) -> boolean

Type

Function

Description

Checks to see if an element matches what we think it should be.

Parameters

Returns

Constructors

new

Signature

cp.ui.MenuButton.new(parent, finderFn) -> MenuButton

Type

Constructor

Description

Creates a new MenuButton.

Parameters

Methods

getTitle

Signature

`cp.ui.MenuButton:getTitle() -> string

nil` </span>

Type

Method

Description

Gets the MenuButton title.

Parameters

Returns

getValue

Signature

`cp.ui.MenuButton:getValue() -> string

nil` </span>

Type

Method

Description

Gets the MenuButton value.

Parameters

Returns

isEnabled

Signature

cp.ui.MenuButton:isEnabled() -> boolean

Type

Method

Description

Is the MenuButton enabled?

Parameters

Returns

Signature

cp.ui.MenuButton:loadLayout(layout) -> none

Type

Method

Description

Loads a MenuButton layout.

Parameters

Returns

parent

Signature

cp.ui.MenuButton:parent() -> parent

Type

Method

Description

Returns the parent object.

Parameters

Returns

press

Signature

cp.ui.MenuButton:press() -> self

Type

Method

Description

Presses the MenuButton.

Parameters

Returns

Signature

cp.ui.MenuButton:saveLayout() -> table

Type

Method

Description

Saves the current MenuButton layout to a table.

Parameters

Returns

Signature

cp.ui.MenuButton:selectItem(index) -> boolean

Type

Method

Description

Select an item on the MenuButton by index.

Parameters

Returns

Signature

cp.ui.MenuButton:selectItemMatching(pattern) -> boolean

Type

Method

Description

Select an item on the MenuButton by pattern.

Parameters

Returns

setValue

Signature

cp.ui.MenuButton:setValue(value) -> self

Type

Method

Description

Sets the MenuButton value.

Parameters

Returns

show

Signature

cp.ui.MenuButton:show() -> self

Type

Method

Description

Show's the MenuButton.

Parameters

Returns

snapshot

Signature

`cp.ui.MenuButton:snapshot([path]) -> hs.image

nil` </span>

Type

Method

Description

Takes a snapshot of the UI in its current state as a PNG and returns it.

Parameters