#cp.ui.Toolbar

Toolbar 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.Toolbar.matches(element) -> boolean
TypeFunction
DescriptionChecks if the element is a Button, returning true if so.
Parameters
  • element - The hs.axuielement to check.
Returns
  • true if the element is a Button, or false if not.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Toolbar.lua line 15

#Constructors

Signaturecp.ui.Toolbar(parent, uiFinder) -> cp.ui.Toolbar
TypeConstructor
DescriptionCreates a new Toolbar instance, given the specified parent and uiFinder
Parameters
  • parent - The parent object.
  • uiFinder - The cp.prop or function that finds the hs.axuielement that represents the Toolbar.
Returns
  • The new Toolbar instance.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Toolbar.lua line 28

#Fields

Signaturecp.ui.Toolbar.overflowButton <cp.ui.Button>
TypeField
DescriptionThe "overflow" button which appears if there are more toolbar items
NotesNone
Sourcesrc/extensions/cp/ui/Toolbar.lua line 64

Signaturecp.ui.Toolbar.selectedTitle <cp.prop: string; read-only>
TypeField
DescriptionThe title of the first selected item, if available.
NotesNone
Sourcesrc/extensions/cp/ui/Toolbar.lua line 51

#Methods

Signaturecp.ui.Toolbar:doSelect(title) -> Statement
TypeMethod
DescriptionReturns a Statement that will select the toolbar item with the specified title.
Parameters
  • title - The title to select, if present.
Returns
  • A Statement that when executed returns true if the item was found and selected, otherwise false.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/Toolbar.lua line 75