docs » cp.ui.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

new

Signature cp.ui.PopUpButton.new(axuielement, function) -> cp.ui.PopUpButton
Type Constructor
Description Creates a new PopUpButton.
Parameters
  • parent - The parent table. Should have a isShowing property.
Returns
  • The new PopUpButton instance.

Methods

getValue

Signature `cp.ui.PopUpButton:getValue() -> string nil` </span>
Type Method
Description Gets the PopUpButton value.
Parameters
  • None
Returns
  • The PopUpButton value as string, or nil if the value cannot be determined.

isEnabled

Signature cp.ui.PopUpButton:isEnabled() -> boolean
Type Method
Description Is the PopUpButton enabled?
Parameters
  • None
Returns
  • true if enabled otherwise false.

loadLayout

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 cp.ui.PopUpButton:saveLayout().
Returns
  • None

parent

Signature cp.ui.PopUpButton:parent() -> parent
Type Method
Description Returns the parent object.
Parameters
  • None
Returns
  • parent

press

Signature cp.ui.PopUpButton:press() -> self
Type Method
Description Presses the PopUpButton.
Parameters
  • None
Returns
  • self

saveLayout

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.

selectItem

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

snapshot

Signature `cp.ui.PopUpButton: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
  • path - (optional) The path to save the file. Should include the extension (should be .png).

results matching ""

    No results matching ""