cp.ui.Menu

UI for AXMenus.


API Overview

Functions - API calls offered directly by the extension

  • matches

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

  • Menu

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

  • cancel
  • doCancel
  • doSelectItem
  • doSelectValue

API Documentation

Functions

matches

   
Signature cp.ui.Menu.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
Notes None
Examples None
Source src/extensions/cp/ui/Menu.lua line 33

Constructors

   
Signature cp.ui.Menu(parent, uiFinder) -> Menu
Type Constructor
Description Creates 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.
Notes None
Examples None
Source src/extensions/cp/ui/Menu.lua line 21

Methods

cancel

   
Signature cp.ui.Menu:cancel() -> self
Type Method
Description Closes a menu.
Parameters
  • None
Returns
  • Self
Notes None
Examples None
Source src/extensions/cp/ui/Menu.lua line 46

doCancel

   
Signature cp.ui.Menu:doCancel(value) -> cp.rx.go.Statement
Type Method
Description A Statement that will cancel a menu.
Parameters
  • None
Returns
  • the Statement.
Notes None
Examples None
Source src/extensions/cp/ui/Menu.lua line 63

doSelectItem

   
Signature cp.ui.Menu:doSelectItem(index) -> cp.rx.go.Statement
Type Method
Description A Statement that will select an item on the MenuButton by index.
Parameters
  • index - The index number of the item to match.
Returns
  • the Statement.
Notes None
Examples None
Source src/extensions/cp/ui/Menu.lua line 81

doSelectValue

   
Signature cp.ui.Menu:doSelectValue(pattern[, altPattern]) -> cp.rx.go.Statement
Type Method
Description A 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.
Notes None
Examples None
Source src/extensions/cp/ui/Menu.lua line 131