#cp.ui.Menu

UI for AXMenus.


#API Overview

Functions - API calls offered directly by the extension

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

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


#API Documentation

#Functions

Signaturecp.ui.Menu.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/Menu.lua line 33

#Constructors

Signaturecp.ui.Menu(parent, uiFinder) -> Menu
TypeConstructor
DescriptionCreates a new Menu instance.
Parameters
  • parent - The parent object.
  • uiFinder - A function which will return the hs.axuielement when available.
Returns
  • A new Menu object.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Menu.lua line 21

#Methods

Signaturecp.ui.Menu:cancel() -> self
TypeMethod
DescriptionCloses a menu.
Parameters
  • None
Returns
  • Self
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Menu.lua line 46

Signaturecp.ui.Menu:doCancel(value) -> cp.rx.go.Statement
TypeMethod
DescriptionA Statement that will cancel a menu.
Parameters
  • None
Returns
  • the Statement.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Menu.lua line 63

Signaturecp.ui.Menu:doSelectItem(index) -> cp.rx.go.Statement
TypeMethod
DescriptionA Statement that will select an item on the MenuButton by index.
Parameters
  • index - The index number of the item to match.
Returns
  • the Statement.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Menu.lua line 81

Signaturecp.ui.Menu:doSelectValue(pattern[, altPattern]) -> cp.rx.go.Statement
TypeMethod
DescriptionA Statement that will select an item on the Menu by value.
Parameters
  • pattern - The pattern to match.
  • [altPattern] - An optional alternate pattern to match if the first pattern fails.
Returns
  • the Statement.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Menu.lua line 131