#cp.ui.PopUpButton

Pop Up Button Module.


#API Overview

Functions - API calls offered directly by the extension

Constructors - API calls which return an object, typically one that offers API methods

Fields - Variables which can only be accessed from an object returned by a constructor

Methods - API calls which can only be made on an object returned by a constructor


#API Documentation

#Functions

Signaturecp.ui.PopUpButton.matches(element) -> boolean
TypeFunction
DescriptionChecks to see if an element matches what we think it should be.
Parameters
  • element - An axuielementObject to check.
Returns
  • true if matches otherwise false
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 24

#Constructors

Signaturecp.ui.PopUpButton(parent, uiFinder) -> cp.ui.PopUpButton
TypeConstructor
DescriptionCreates a new PopUpButton.
Parameters
  • parent - The parent table. Should have a isShowing property.
  • uiFinder - The function or cp.prop that provides the current hs.axuielement.
Returns
  • The new PopUpButton instance.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 37

#Fields

Signaturecp.ui.PopUpButton.menuUI <cp.prop: hs.axuielement; read-only; live?>
TypeField
DescriptionReturns the AXMenu for the PopUpMenu if it is currently visible.
NotesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 81

Signaturecp.ui.PopUpButton.value <cp.prop: anything; live>
TypeField
DescriptionReturns or sets the current PopUpButton value.
NotesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 48

#Methods

Signaturecp.ui.PopUpButton:doPress() -> cp.rx.go.Statement
TypeMethod
DescriptionA Statement that presses the PopUpButton.
Parameters
  • None
Returns
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 235

Signaturecp.ui.PopUpButton:doSelectItem(index) -> cp.rx.go.Statement
TypeMethod
DescriptionA 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.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 124

Signaturecp.ui.PopUpButton:doSelectValue(value, [overrideValue]) -> cp.rx.go.Statement
TypeMethod
DescriptionA Statement that will select an item on the PopUpButton by value.
Parameters
  • value - The value of the item to match.
  • overrideValue - This optional value overides the above value for the initial compare as a workaround for PopUp that have titles that don't update correctly.
Returns
  • the Statement.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 152

Signaturecp.ui.PopUpButton:getValue() -> string | nil
TypeMethod
DescriptionGets the PopUpButton value.
Parameters
  • None
Returns
  • The PopUpButton value as string, or nil if the value cannot be determined.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 191

Signaturecp.ui.PopUpButton:loadLayout(layout) -> none
TypeMethod
DescriptionLoads a PopUpButton layout.
Parameters
  • layout - A table containing the PopUpButton layout settings - created using saveLayout.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 283

Signaturecp.ui.PopUpButton:press() -> self
TypeMethod
DescriptionPresses the PopUpButton.
Parameters
  • None
Returns
  • self
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 218

Signaturecp.ui.PopUpButton:saveLayout() -> table
TypeMethod
DescriptionSaves the current PopUpButton layout to a table.
Parameters
  • None
Returns
  • A table containing the current PopUpButton Layout.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 268

Signaturecp.ui.PopUpButton:selectItem(index) -> self
TypeMethod
DescriptionSelect an item on the PopUpButton by index.
Parameters
  • index - The index of the item you want to select.
Returns
  • self
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 97

Signaturecp.ui.PopUpButton:setValue(value) -> self
TypeMethod
DescriptionSets the PopUpButton value.
Parameters
  • value - The value you want to set the PopUpButton to.
Returns
  • self
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/PopUpButton.lua line 204