Internationalisation
Bundled Plugins API
PopUpButton
Pop Up Button Module.

API Overview

API Documentation

Functions

matches

Signature
cp.ui.PopUpButton.matches(element) -> boolean
Type
Function
Description
Checks to see if an element matches what we think it should be.
Parameters
  • element - An axuielementObject to check.
Returns
  • true if matches otherwise false

Constructors

Signature
cp.ui.PopUpButton(parent, uiFinder) -> cp.ui.PopUpButton
Type
Constructor
Description
Creates a new PopUpButton.
Parameters
  • parent - The parent table. Should have a isShowing property.
  • uiFinder - The function or cp.prop that provides the current hs._asm.axuielement.
Returns
  • The new PopUpButton instance.

Fields

Signature
cp.ui.PopUpButton.menuUI <cp.prop: hs._asm.axuielement; read-only; live?>
Type
Field
Description
Returns the AXMenu for the PopUpMenu if it is currently visible.

value

Signature
cp.ui.PopUpButton.value <cp.prop: anything; live>
Type
Field
Description
Returns or sets the current PopUpButton value.

Methods

doPress

Signature
cp.ui.PopUpButton:doPress() -> cp.rx.go.Statement
Type
Method
Description
A Statement that presses the PopUpButton.
Parameters
  • None
Returns
Signature
cp.ui.PopUpButton:doSelectItem(index) -> cp.rx.go.Statement
Type
Method
Description
A Statement that will select an item on the PopUpButton by index.
Parameters
  • index - The index number of the item you want to select.
Returns
  • the Statement.
Signature
cp.ui.PopUpButton:doSelectValue(value) -> cp.rx.go.Statement
Type
Method
Description
A Statement that will select an item on the PopUpButton by value.
Parameters
  • value - The value of the item to match.
Returns
  • the Statement.

getValue

| Signature | cp.ui.PopUpButton:getValue() -> string | nil | | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Gets the PopUpButton value. | | Parameters |
  • None
| | Returns |
  • The PopUpButton value as string, or nil if the value cannot be determined.
|
Signature
cp.ui.PopUpButton:loadLayout(layout) -> none
Type
Method
Description
Loads a PopUpButton layout.
Parameters
  • layout - A table containing the PopUpButton layout settings - created using saveLayout.
Returns
  • None

press

Signature
cp.ui.PopUpButton:press() -> self
Type
Method
Description
Presses the PopUpButton.
Parameters
  • None
Returns
  • self
Signature
cp.ui.PopUpButton:saveLayout() -> table
Type
Method
Description
Saves the current PopUpButton layout to a table.
Parameters
  • None
Returns
  • A table containing the current PopUpButton Layout.
Signature
cp.ui.PopUpButton:selectItem(index) -> self
Type
Method
Description
Select an item on the PopUpButton by index.
Parameters
  • index - The index of the item you want to select.
Returns
  • self

setValue

Signature
cp.ui.PopUpButton:setValue(value) -> self
Type
Method
Description
Sets the PopUpButton value.
Parameters
  • value - The value you want to set the PopUpButton to.
Returns
  • self
Last modified 1mo ago