Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
62 lines (49 loc) · 4.46 KB

cp.ui.Toolbar.md

File metadata and controls

62 lines (49 loc) · 4.46 KB

docs » 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

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._asm.axuielement to check.
Returns
  • true if the element is a Button, or false if not.

Constructors

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._asm.axuielement that represents the Toolbar.
Returns
  • The new Toolbar instance.

Fields

Signature cp.ui.Toolbar.overflowButton <cp.ui.Button>
Type Field
Description The "overflow" button which appears if there are more toolbar items
Signature cp.ui.Toolbar.selectedTitle <cp.prop: string; read-only>
Type Field
Description The title of the first selected item, if available.

Methods

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.