# cp.ui.Toolbar

Toolbar Module.


# API Overview

Functions - API calls offered directly by the extension

  • matches

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

  • Toolbar

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

  • overflowButton
  • selectedTitle

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

  • doSelect

# API Documentation

# Functions

# matches

Signature cp.ui.Toolbar.matches(element) -> boolean
Type Function
Description Checks 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.
Notes None
Examples None
Source src/extensions/cp/ui/Toolbar.lua line 15

# Constructors

# Toolbar

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

# Fields

# overflowButton

Signature cp.ui.Toolbar.overflowButton <cp.ui.Button>
Type Field
Description The "overflow" button which appears if there are more toolbar items
Notes None
Source src/extensions/cp/ui/Toolbar.lua line 64

# selectedTitle

Signature cp.ui.Toolbar.selectedTitle <cp.prop: string; read-only>
Type Field
Description The title of the first selected item, if available.
Notes None
Source src/extensions/cp/ui/Toolbar.lua line 51

# Methods

# doSelect

Signature cp.ui.Toolbar:doSelect(title) -> Statement
Type Method
Description Returns 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.
Notes None
Examples None
Source src/extensions/cp/ui/Toolbar.lua line 75